public class DefaultVertex<I,V,E> extends java.lang.Object implements Vertex<java.lang.String,java.lang.Integer,DefaultEdge>
| Constructor and Description |
|---|
DefaultVertex() |
| Modifier and Type | Method and Description |
|---|---|
void |
addEdge(DefaultEdge edge)
Add an edge for this vertex (happens immediately)
|
java.lang.Iterable<DefaultEdge> |
getEdges()
Get a read-only view of the out-edges of this vertex.
|
java.lang.Integer |
getEdgeValue(java.lang.String targetVertexId)
Return the value of the first edge with the given target vertex id,
or null if there is no such edge.
|
java.lang.String |
getId()
Get the vertex id.
|
int |
getNumEdges()
Get the number of outgoing edges on this vertex.
|
java.lang.Integer |
getValue()
Get the vertex value (data stored with vertex)
|
void |
initialize(java.lang.String id,
java.lang.Integer value)
Initialize id and value.
|
void |
initialize(java.lang.String id,
java.lang.Integer value,
java.lang.Iterable<DefaultEdge> edges)
Initialize id, value, and edges.
|
void |
removeEdges(java.lang.String targetVertexId)
Removes all edges pointing to the given vertex id.
|
void |
setEdges(java.lang.Iterable<DefaultEdge> edges)
Set the outgoing edges for this vertex.
|
void |
setEdgeValue(java.lang.String targetVertexId,
java.lang.Integer edgeValue)
If an edge to the target vertex exists, set it to the given edge value.
|
void |
setValue(java.lang.Integer value)
Set the vertex data (immediately visible in the computation)
|
public void initialize(java.lang.String id,
java.lang.Integer value,
java.lang.Iterable<DefaultEdge> edges)
Vertexinitialize in interface Vertex<java.lang.String,java.lang.Integer,DefaultEdge>id - Vertex idvalue - Vertex valueedges - Iterable of edgespublic void initialize(java.lang.String id,
java.lang.Integer value)
Vertexinitialize in interface Vertex<java.lang.String,java.lang.Integer,DefaultEdge>id - Vertex idvalue - Vertex valuepublic java.lang.String getId()
VertexgetId in interface Vertex<java.lang.String,java.lang.Integer,DefaultEdge>public java.lang.Integer getValue()
VertexgetValue in interface Vertex<java.lang.String,java.lang.Integer,DefaultEdge>public void setValue(java.lang.Integer value)
VertexsetValue in interface Vertex<java.lang.String,java.lang.Integer,DefaultEdge>value - Vertex data to be setpublic int getNumEdges()
VertexgetNumEdges in interface Vertex<java.lang.String,java.lang.Integer,DefaultEdge>public java.lang.Iterable<DefaultEdge> getEdges()
VertexgetEdges in interface Vertex<java.lang.String,java.lang.Integer,DefaultEdge>public void setEdges(java.lang.Iterable<DefaultEdge> edges)
VertexsetEdges in interface Vertex<java.lang.String,java.lang.Integer,DefaultEdge>edges - Iterable of edgespublic java.lang.Integer getEdgeValue(java.lang.String targetVertexId)
VertexgetEdgeValue in interface Vertex<java.lang.String,java.lang.Integer,DefaultEdge>targetVertexId - Target vertex idpublic void setEdgeValue(java.lang.String targetVertexId,
java.lang.Integer edgeValue)
VertexsetEdgeValue in interface Vertex<java.lang.String,java.lang.Integer,DefaultEdge>targetVertexId - Target vertex idedgeValue - Edge valuepublic void addEdge(DefaultEdge edge)
VertexaddEdge in interface Vertex<java.lang.String,java.lang.Integer,DefaultEdge>edge - Edge to addpublic void removeEdges(java.lang.String targetVertexId)
VertexremoveEdges in interface Vertex<java.lang.String,java.lang.Integer,DefaultEdge>targetVertexId - the target vertex id