public class SsspDefaultVertex<I,V,E> extends java.lang.Object implements Vertex<java.lang.String,java.lang.Integer,DefaultEdge>
Constructor and Description |
---|
SsspDefaultVertex() |
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)
Vertex
initialize
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)
Vertex
initialize
in interface Vertex<java.lang.String,java.lang.Integer,DefaultEdge>
id
- Vertex idvalue
- Vertex valuepublic java.lang.String getId()
Vertex
getId
in interface Vertex<java.lang.String,java.lang.Integer,DefaultEdge>
public java.lang.Integer getValue()
Vertex
getValue
in interface Vertex<java.lang.String,java.lang.Integer,DefaultEdge>
public void setValue(java.lang.Integer value)
Vertex
setValue
in interface Vertex<java.lang.String,java.lang.Integer,DefaultEdge>
value
- Vertex data to be setpublic int getNumEdges()
Vertex
getNumEdges
in interface Vertex<java.lang.String,java.lang.Integer,DefaultEdge>
public java.lang.Iterable<DefaultEdge> getEdges()
Vertex
getEdges
in interface Vertex<java.lang.String,java.lang.Integer,DefaultEdge>
public void setEdges(java.lang.Iterable<DefaultEdge> edges)
Vertex
setEdges
in interface Vertex<java.lang.String,java.lang.Integer,DefaultEdge>
edges
- Iterable of edgespublic java.lang.Integer getEdgeValue(java.lang.String targetVertexId)
Vertex
getEdgeValue
in interface Vertex<java.lang.String,java.lang.Integer,DefaultEdge>
targetVertexId
- Target vertex idpublic void setEdgeValue(java.lang.String targetVertexId, java.lang.Integer edgeValue)
Vertex
setEdgeValue
in interface Vertex<java.lang.String,java.lang.Integer,DefaultEdge>
targetVertexId
- Target vertex idedgeValue
- Edge valuepublic void addEdge(DefaultEdge edge)
Vertex
addEdge
in interface Vertex<java.lang.String,java.lang.Integer,DefaultEdge>
edge
- Edge to addpublic void removeEdges(java.lang.String targetVertexId)
Vertex
removeEdges
in interface Vertex<java.lang.String,java.lang.Integer,DefaultEdge>
targetVertexId
- the target vertex id