|
|||||||||||
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 ArchetypeVertex
ArchetypeVertex.getGraph()
public java.util.Set getNeighbors()
ArchetypeVertex
ArchetypeVertex
.
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 ArchetypeVertex
ArchetypeVertex.getNeighbors()
public int numNeighbors()
ArchetypeVertex
numNeighbors
in interface ArchetypeVertex
ArchetypeVertex.numNeighbors()
public java.util.Set getIncidentEdges()
ArchetypeVertex
ArchetypeEdge
.
getIncidentEdges
in interface ArchetypeVertex
ArchetypeVertex.getIncidentEdges()
public int degree()
ArchetypeVertex
degree
in interface ArchetypeVertex
ArchetypeVertex.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 ArchetypeVertex
ArchetypeVertex.getEqualVertex(ArchetypeGraph)
public ArchetypeVertex getEquivalentVertex(ArchetypeGraph ag)
getEquivalentVertex
in interface ArchetypeVertex
public int hashCode()
Object.hashCode()
public boolean isNeighborOf(ArchetypeVertex v)
ArchetypeVertex
true
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 ArchetypeVertex
ArchetypeVertex.isNeighborOf(ArchetypeVertex)
public boolean isIncident(ArchetypeEdge e)
ArchetypeVertex
true
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 ArchetypeVertex
ArchetypeVertex.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 Vertex
Vertex.findEdge(Vertex)
public java.util.Set findEdgeSet(Vertex v)
Vertex
v
. If v
is not connected to this vertex, returns an empty Set
.
findEdgeSet
in interface Vertex
Vertex.findEdgeSet(Vertex)
public ArchetypeVertex copy(ArchetypeGraph newGraph)
ArchetypeVertex
g
. 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 ArchetypeVertex
newGraph
- the graph in which the copied vertex will be placed
ArchetypeVertex.copy(ArchetypeGraph)
public java.lang.String toString()
toString
in class UserData
Object.toString()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |