edu.uci.ics.jung.graph.impl
Class AbstractArchetypeVertex

java.lang.Object
  extended by edu.uci.ics.jung.utils.UserDataDelegate
      extended by edu.uci.ics.jung.graph.impl.AbstractElement
          extended by edu.uci.ics.jung.graph.impl.AbstractArchetypeVertex
All Implemented Interfaces:
ArchetypeVertex, Element, UserDataContainer, Cloneable
Direct Known Subclasses:
AbstractHypervertex, AbstractSparseVertex

public abstract class AbstractArchetypeVertex
extends AbstractElement
implements ArchetypeVertex

Author:
Joshua O'Madadhain

Nested Class Summary
 
Nested classes/interfaces inherited from interface edu.uci.ics.jung.utils.UserDataContainer
UserDataContainer.CopyAction
 
Field Summary
 
Fields inherited from class edu.uci.ics.jung.graph.impl.AbstractElement
id, m_Graph
 
Fields inherited from class edu.uci.ics.jung.utils.UserDataDelegate
factory, udc_delegate
 
Constructor Summary
AbstractArchetypeVertex()
           
 
Method Summary
 ArchetypeVertex copy(ArchetypeGraph g)
          Creates a copy of this vertex in graph g.
 int degree()
          Returns the number of edges incident to this vertex.
 boolean equals(Object o)
          Returns true if o is an instance of ArchetypeVertex that is equivalent to this vertex.
 ArchetypeEdge findEdge(ArchetypeVertex v)
          Returns an edge that connects this vertex to v.
 Set findEdgeSet(ArchetypeVertex v)
          Returns the set of all edges that connect this vertex with the specified vertex v.
protected abstract  Collection getEdges_internal()
          Returns a set containing all the incident edges of this vertex.
 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).
 Set getIncidentEdges()
          Returns the set of edges which are incident to this vertex.
 Set getIncidentElements()
          Returns the set of elements that are incident to this element.
protected abstract  Collection getNeighbors_internal()
          Returns a set containing all neighbors of this vertex.
 Set getNeighbors()
          Returns the set of vertices which are connected to this vertex via edges; each of these vertices should implement ArchetypeVertex.
 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.
 
Methods inherited from class edu.uci.ics.jung.graph.impl.AbstractElement
addGraph_internal, getGraph, hashCode, initialize, removeGraph_internal
 
Methods inherited from class edu.uci.ics.jung.utils.UserDataDelegate
addUserDatum, clone, containsUserDatumKey, getUserDatum, getUserDatumCopyAction, getUserDatumKeyIterator, importUserData, removeUserDatum, setUserDataFactory, setUserDatum
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface edu.uci.ics.jung.graph.Element
getGraph
 
Methods inherited from interface edu.uci.ics.jung.utils.UserDataContainer
addUserDatum, clone, containsUserDatumKey, getUserDatum, getUserDatumCopyAction, getUserDatumKeyIterator, importUserData, removeUserDatum, setUserDatum
 

Constructor Detail

AbstractArchetypeVertex

public AbstractArchetypeVertex()
Method Detail

getIncidentElements

public Set getIncidentElements()
Description copied from interface: Element
Returns the set of elements that are incident to this element. For a vertex this corresponds to returning the vertex's incident edges; for an edge this corresponds to returning the edge's incident vertices.

Specified by:
getIncidentElements in interface Element
See Also:
Element.getIncidentElements()

getNeighbors

public Set getNeighbors()
Description copied from interface: ArchetypeVertex
Returns the set of vertices which are connected to this vertex via edges; each of these vertices should implement ArchetypeVertex. If this vertex is connected to itself with a self-loop, then this vertex will be included in its own neighbor set.

Specified by:
getNeighbors in interface ArchetypeVertex
See Also:
ArchetypeVertex.getNeighbors()

numNeighbors

public int numNeighbors()
Description copied from interface: ArchetypeVertex
Returns the number of neighbors that this vertex has. If the graph is directed, the value returned will be the sum of the number of predecessors and the number of successors that this vertex has.

Specified by:
numNeighbors in interface ArchetypeVertex
See Also:
ArchetypeVertex.numNeighbors()

getIncidentEdges

public Set getIncidentEdges()
Description copied from interface: ArchetypeVertex
Returns the set of edges which are incident to this vertex. Each of these edges should implement ArchetypeEdge.

Specified by:
getIncidentEdges in interface ArchetypeVertex
See Also:
ArchetypeVertex.getIncidentEdges()

degree

public int degree()
Description copied from interface: ArchetypeVertex
Returns the number of edges incident to this vertex. Special cases of interest:

Specified by:
degree in interface ArchetypeVertex
Returns:
int the degree of this node
See Also:
ArchetypeVertex.degree()

isNeighborOf

public boolean isNeighborOf(ArchetypeVertex v)
Description copied from interface: ArchetypeVertex
Returns 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.

Specified by:
isNeighborOf in interface ArchetypeVertex
See Also:
ArchetypeVertex.isNeighborOf(ArchetypeVertex)

isIncident

public boolean isIncident(ArchetypeEdge e)
Description copied from interface: ArchetypeVertex
Returns 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.

Specified by:
isIncident in interface ArchetypeVertex
See Also:
ArchetypeVertex.isIncident(ArchetypeEdge)

copy

public ArchetypeVertex copy(ArchetypeGraph g)
Description copied from interface: ArchetypeVertex
Creates a copy of this vertex in graph 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.

Specified by:
copy in interface ArchetypeVertex
Parameters:
g - the graph in which the copied vertex will be placed
Returns:
the vertex created
See Also:
ArchetypeVertex.copy(edu.uci.ics.jung.graph.ArchetypeGraph)

equals

public boolean equals(Object o)
Returns 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().

Overrides:
equals in class Object
See Also:
Object.equals(java.lang.Object), ArchetypeVertex.getEqualVertex(ArchetypeGraph), ArchetypeVertex.copy(edu.uci.ics.jung.graph.ArchetypeGraph)

getEqualVertex

public ArchetypeVertex getEqualVertex(ArchetypeGraph ag)
Returns the vertex in the specified graph ag that is equivalent to this vertex. If there is no such vertex, or if ag is not an instance of AbstractSparseGraph, returns null.

Specified by:
getEqualVertex in interface ArchetypeVertex
See Also:
ArchetypeVertex.getEqualVertex(ArchetypeGraph)

getEquivalentVertex

public ArchetypeVertex getEquivalentVertex(ArchetypeGraph ag)
Deprecated. As of version 1.4, renamed to getEqualVertex(ag).

Specified by:
getEquivalentVertex in interface ArchetypeVertex

findEdge

public ArchetypeEdge findEdge(ArchetypeVertex v)
Description copied from interface: ArchetypeVertex
Returns an edge that connects this vertex to v. If this edge is not uniquely defined (that is, if the graph contains more than one edge connecting this vertex to v), any of these edges v may be returned. findEdgeSet(v) may be used to return all such edges. If v is not connected to this vertex, returns null.

Specified by:
findEdge in interface ArchetypeVertex
See Also:
ArchetypeVertex.findEdge(edu.uci.ics.jung.graph.ArchetypeVertex)

findEdgeSet

public Set findEdgeSet(ArchetypeVertex v)
Description copied from interface: ArchetypeVertex
Returns the set of all edges that connect this vertex with the specified vertex v. findEdge(v) may be used to return a single (arbitrary) element of this set. If v is not connected to this vertex, returns an empty Set.

Specified by:
findEdgeSet in interface ArchetypeVertex
See Also:
ArchetypeVertex.findEdgeSet(edu.uci.ics.jung.graph.ArchetypeVertex)

getNeighbors_internal

protected abstract Collection getNeighbors_internal()
Returns a set containing all neighbors of this vertex. This is an internal method which is not intended for users.


getEdges_internal

protected abstract Collection getEdges_internal()
Returns a set containing all the incident edges of this vertex. This is an internal method which is not intended for users.