|
|||||||||||
| 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
This class provides a skeletal implementation of the Vertex
interface to minimize the effort required to implement this interface.
It is appropriate for sparse graphs (those in which each vertex
is connected to only a few other vertices); for dense graphs (those in
which each vertex is connected to most other vertices), another
implementation might be more appropriate.
This class extends UserData, which provides storage and
retrieval mechanisms for user-defined data for each edge instance.
This allows users to attach data to edges without having to extend
this class.
AbstractSparseGraph,
AbstractSparseEdge| 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 |
| Method Summary | |
ArchetypeVertex |
copy(ArchetypeGraph newGraph)
Creates a copy of this vertex in graph g. |
int |
degree()
Returns the number of edges incident to this vertex. |
boolean |
equals(java.lang.Object o)
Returns true if o is an instance of
ArchetypeVertex that is equivalent to this vertex.
|
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. |
ArchetypeVertex |
getEqualVertex(ArchetypeGraph ag)
Returns the vertex in the specified graph ag
that is equivalent to this vertex. |
ArchetypeVertex |
getEquivalentVertex(ArchetypeGraph ag)
Deprecated. As of version 1.4, renamed to getEqualVertex(ag). |
ArchetypeGraph |
getGraph()
Returns a reference to the graph that contains this vertex. |
java.util.Set |
getIncidentEdges()
Returns the set of edges which are incident to this vertex. |
java.util.Set |
getNeighbors()
Returns the set of vertices which are connected to this vertex via edges; each of these vertices should implement ArchetypeVertex.
|
int |
hashCode()
|
boolean |
isIncident(ArchetypeEdge e)
Returns true if the specified edge e is
incident to this vertex, and false otherwise.
|
boolean |
isNeighborOf(ArchetypeVertex v)
Returns true if the specified vertex v and
this vertex are each incident
to one or more of the same edges, and false otherwise.
|
int |
numNeighbors()
Returns the number of neighbors that this vertex has. |
java.lang.String |
toString()
Returns a human-readable representation of this vertex. |
| 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.graph.Vertex |
getInEdges, getOutEdges, getPredecessors, getSuccessors, inDegree, isDest, isPredecessorOf, isSource, isSuccessorOf, numPredecessors, numSuccessors, outDegree |
| Methods inherited from interface edu.uci.ics.jung.utils.UserDataContainer |
addUserDatum, containsUserDatumKey, getUserDatum, getUserDatumCopyAction, getUserDatumKeyIterator, importUserData, removeUserDatum, setUserDatum |
| Method Detail |
public ArchetypeGraph getGraph()
ArchetypeVertex
getGraph in interface ArchetypeVertexArchetypeVertex.getGraph()public java.util.Set getNeighbors()
ArchetypeVertexArchetypeVertex.
If this vertex is connected to itself with a self-loop, then
this vertex will be included in its own neighbor set.
getNeighbors in interface ArchetypeVertexArchetypeVertex.getNeighbors()public int numNeighbors()
ArchetypeVertex
numNeighbors in interface ArchetypeVertexArchetypeVertex.numNeighbors()public java.util.Set getIncidentEdges()
ArchetypeVertexArchetypeEdge.
getIncidentEdges in interface ArchetypeVertexArchetypeVertex.getIncidentEdges()public int degree()
ArchetypeVertex
degree in interface ArchetypeVertexArchetypeVertex.degree()public boolean equals(java.lang.Object o)
true if o is an instance of
ArchetypeVertex that is equivalent to this vertex.
Respects the vertex
equivalences which are established by copy() and
referenced by getEquivalentVertex().
Object.equals(java.lang.Object),
ArchetypeVertex.getEqualVertex(ArchetypeGraph),
ArchetypeVertex.copy(edu.uci.ics.jung.graph.ArchetypeGraph)public ArchetypeVertex getEqualVertex(ArchetypeGraph ag)
ag
that is equivalent to this vertex. If there is no
such vertex, or if ag is not an instance
of AbstractSparseGraph, returns null.
getEqualVertex in interface ArchetypeVertexArchetypeVertex.getEqualVertex(ArchetypeGraph)public ArchetypeVertex getEquivalentVertex(ArchetypeGraph ag)
getEquivalentVertex in interface ArchetypeVertexpublic int hashCode()
Object.hashCode()public boolean isNeighborOf(ArchetypeVertex v)
ArchetypeVertextrue if the specified vertex v and
this vertex are each incident
to one or more of the same edges, and false otherwise.
The behavior of this method is undefined if v is not
an element of this vertex's graph.
isNeighborOf in interface ArchetypeVertexArchetypeVertex.isNeighborOf(ArchetypeVertex)public boolean isIncident(ArchetypeEdge e)
ArchetypeVertextrue if the specified edge e is
incident to this vertex, and false otherwise.
The behavior of this method is undefined if e is not
an element of this vertex's graph.
isIncident in interface ArchetypeVertexArchetypeVertex.isIncident(ArchetypeEdge)public Edge findEdge(Vertex v)
v. 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 VertexVertex.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 VertexVertex.findEdgeSet(Vertex)public ArchetypeVertex copy(ArchetypeGraph newGraph)
ArchetypeVertexg. The vertex
created will be equivalent to this vertex: given
v = this.copy(g), then
this.getEquivalentVertex(g) == v, and
this.equals(v) == true.
copy in interface ArchetypeVertexnewGraph - the graph in which the copied vertex will be placed
ArchetypeVertex.copy(ArchetypeGraph)public java.lang.String toString()
toString in class UserDataObject.toString()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||