|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectedu.uci.ics.jung.utils.UserData
edu.uci.ics.jung.graph.impl.AbstractSparseVertex
edu.uci.ics.jung.graph.impl.SimpleSparseVertex
An implementation of Vertex that resides in a
sparse graph which may contain both directed and undirected edges.
It does not support parallel edges.
This implementation stores hash tables that map the successors
of this vertex to its outgoing edges, and its predecessors to
its incoming edges. This enables an efficient implementation of
findEdge(Vertex), but causes the routines that
return the sets of neighbors and of incident edges to require
time proportional to the number of neighbors.
| Nested Class Summary |
| Nested classes inherited from class edu.uci.ics.jung.utils.UserDataContainer |
UserDataContainer.CopyAction |
| Field Summary |
| Fields inherited from class edu.uci.ics.jung.utils.UserData |
CLONE, REMOVE, SHARED |
| Constructor Summary | |
SimpleSparseVertex()
Creates a new instance of a vertex for inclusion in a sparse graph. |
|
| Method Summary | |
Edge |
findEdge(Vertex v)
Returns the edge that connects this vertex to the specified vertex v. |
java.util.Set |
findEdgeSet(Vertex v)
Returns the set of all edges that connect this vertex with the specified vertex v. |
java.util.Set |
getInEdges()
Returns the set of incoming edges of this vertex. |
java.util.Set |
getOutEdges()
Returns the set of outgoing edges of this vertex. |
java.util.Set |
getPredecessors()
Returns the set of predecessors of this vertex. |
java.util.Set |
getSuccessors()
Returns the set of successors of this vertex. |
int |
inDegree()
Returns the number of incoming edges that are incident to this vertex. |
boolean |
isDest(Edge e)
Returns true if this vertex is a destination of
the specified edge e, and false otherwise.
|
boolean |
isPredecessorOf(Vertex v)
Returns true if this vertex is a predecessor of
the specified vertex v, and false otherwise.
|
boolean |
isSource(Edge e)
Returns true if this vertex is a source of
the specified edge e, and false otherwise.
|
boolean |
isSuccessorOf(Vertex v)
Returns true if this vertex is a successor of
the specified vertex v, and false otherwise.
|
int |
numPredecessors()
Returns the number of predecessors of this vertex. |
int |
numSuccessors()
Returns the number of successors of this vertex. |
int |
outDegree()
Returns the number of outgoing edges that are incident to this vertex. |
| Methods inherited from class edu.uci.ics.jung.graph.impl.AbstractSparseVertex |
copy, degree, equals, getEqualVertex, getEquivalentVertex, getGraph, getIncidentEdges, getNeighbors, hashCode, isIncident, isNeighborOf, numNeighbors, toString |
| Methods inherited from class edu.uci.ics.jung.utils.UserData |
addUserDatum, containsUserDatumKey, getUserDatum, getUserDatumCopyAction, getUserDatumKeyIterator, importUserData, removeUserDatum, setUserDatum |
| Methods inherited from class java.lang.Object |
getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface edu.uci.ics.jung.utils.UserDataContainer |
addUserDatum, containsUserDatumKey, getUserDatum, getUserDatumCopyAction, getUserDatumKeyIterator, importUserData, removeUserDatum, setUserDatum |
| Constructor Detail |
public SimpleSparseVertex()
| Method Detail |
public java.util.Set getPredecessors()
Vertexv is a predecessor of this vertex if and only if
v.isPredecessorOf(this) returns true.
Each element of the set returned should implement Vertex.
Vertex.getPredecessors()public java.util.Set getSuccessors()
Vertexv is a successor of this vertex if and only if
v.isSuccessorOf(this) returns true.
Each element of the set returned should implement Vertex.
Vertex.getSuccessors()public int inDegree()
Vertex
Vertex.inDegree()public int outDegree()
Vertex
Vertex.outDegree()public int numPredecessors()
Vertex
Vertex.numPredecessors()public int numSuccessors()
Vertex
Vertex.numSuccessors()public boolean isSuccessorOf(Vertex v)
Vertextrue if this vertex is a successor of
the specified vertex v, and false otherwise.
This vertex is a successor of v if and only if
there exists an edge e such that
v.isSource(e) == true and
this.isDest(e) == true.
The behavior of this method is undefined if v is not
an element of this vertex's graph.
Vertex.isSuccessorOf(Vertex)public boolean isPredecessorOf(Vertex v)
Vertextrue if this vertex is a predecessor of
the specified vertex v, and false otherwise.
This vertex is a predecessor of v if and only if
there exists an edge e such that
this.isSource(e) == true and
v.isDest(e) == true.
The behavior of this method is undefined if v is not
an element of this vertex's graph.
Vertex.isPredecessorOf(Vertex)public boolean isSource(Edge e)
Vertextrue if this vertex is a source of
the specified edge e, and false otherwise.
A vertex v is a source of e if e
is an outgoing edge of v.
The behavior of this method is undefined if e is not
an element of this vertex's graph.
Vertex.isSource(Edge)public boolean isDest(Edge e)
Vertextrue if this vertex is a destination of
the specified edge e, and false otherwise.
A vertex v is a destination of e
if e is an incoming edge of v.
The behavior of this method is undefined if e is not
an element of this vertex's graph.
Vertex.isDest(Edge)public java.util.Set getInEdges()
Vertexe is an incoming edge of this vertex if and only if
this.isDest(e) returns true.
Each element of the set returned should implement Edge.
Vertex.getInEdges()public java.util.Set getOutEdges()
Vertexe is an outgoing edge of this vertex if and only if
this.isSource(e) returns true.
Each element of the set returned should implement Edge.
Vertex.getOutEdges()public Edge findEdge(Vertex v)
AbstractSparseVertexv. This is a
simple implementation which checks the opposite vertex of
each outgoing edge of this vertex; this solution is general,
but not efficient.
findEdge in interface VertexfindEdge in class AbstractSparseVertexAbstractSparseVertex.findEdge(Vertex)public java.util.Set findEdgeSet(Vertex v)
Vertexv. If v
is not connected to this vertex, returns an empty Set.
findEdgeSet in interface VertexfindEdgeSet in class AbstractSparseVertexAbstractSparseVertex.findEdgeSet(Vertex)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||