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

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
              extended by edu.uci.ics.jung.graph.impl.AbstractSparseVertex
                  extended by edu.uci.ics.jung.graph.impl.SimpleUndirectedSparseVertex
                      extended by edu.uci.ics.jung.graph.impl.UndirectedSparseVertex
All Implemented Interfaces:
ArchetypeVertex, Element, Vertex, UserDataContainer, Cloneable

public class UndirectedSparseVertex
extends SimpleUndirectedSparseVertex

A vertex class for instances of UndirectedGraph that may contain parallel edges. UndirectedGraph

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
UndirectedSparseVertex()
          Creates a new instance of a vertex for inclusion in a sparse graph.
 
Method Summary
protected  void addNeighbor_internal(Edge e, Vertex v)
          Adds the specified edge e and vertex v to the internal data structures of this vertex.
 Edge findEdge(Vertex v)
          Returns the edge that connects this vertex to the specified vertex v, or null if there is no such edge.
 Set findEdgeSet(Vertex v)
          Returns the set of edges that connect this vertex to the specified vertex.
protected  Collection getEdges_internal()
          Returns a list of all incident edges of this vertex.
protected  void removeNeighbor_internal(Edge e, Vertex v)
          Removes the neighbor from this vertex's internal map.
 
Methods inherited from class edu.uci.ics.jung.graph.impl.SimpleUndirectedSparseVertex
getInEdges, getNeighbors_internal, getNeighborsToEdges, getOutEdges, getPredecessors, getSuccessors, inDegree, initialize, isDest, isPredecessorOf, isSource, isSuccessorOf, numPredecessors, numSuccessors, outDegree, setNeighborsToEdges
 
Methods inherited from class edu.uci.ics.jung.graph.impl.AbstractSparseVertex
copy, findEdge, findEdgeSet, toString
 
Methods inherited from class edu.uci.ics.jung.graph.impl.AbstractArchetypeVertex
degree, equals, getEqualVertex, getEquivalentVertex, getIncidentEdges, getIncidentElements, getNeighbors, isIncident, isNeighborOf, numNeighbors
 
Methods inherited from class edu.uci.ics.jung.graph.impl.AbstractElement
addGraph_internal, getGraph, hashCode, 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, wait, wait, wait
 
Methods inherited from interface edu.uci.ics.jung.graph.ArchetypeVertex
degree, getEqualVertex, getEquivalentVertex, getIncidentEdges, getNeighbors, isIncident, isNeighborOf, numNeighbors
 
Methods inherited from interface edu.uci.ics.jung.graph.Element
getGraph, getIncidentElements
 
Methods inherited from interface edu.uci.ics.jung.utils.UserDataContainer
addUserDatum, clone, containsUserDatumKey, getUserDatum, getUserDatumCopyAction, getUserDatumKeyIterator, importUserData, removeUserDatum, setUserDatum
 

Constructor Detail

UndirectedSparseVertex

public UndirectedSparseVertex()
Creates a new instance of a vertex for inclusion in a sparse graph.

Method Detail

findEdge

public Edge findEdge(Vertex v)
Returns the edge that connects this vertex to the specified vertex v, or null if there is no such edge. Implemented using a hash table for a performance improvement over the implementation in AbstractSparseVertex. Looks for a directed edge first, and then for an undirected edge if no directed edges are found.

Specified by:
findEdge in interface Vertex
Overrides:
findEdge in class SimpleUndirectedSparseVertex
See Also:
Vertex.findEdge(Vertex)

findEdgeSet

public Set findEdgeSet(Vertex v)
Description copied from class: SimpleUndirectedSparseVertex
Returns the set of edges that connect this vertex to the specified vertex. Since this implementation does not allow for parallel edges, this implementation simply returns a set whose contents consist of the return value from findEdge(v).

Specified by:
findEdgeSet in interface Vertex
Overrides:
findEdgeSet in class SimpleUndirectedSparseVertex
See Also:
Vertex.findEdgeSet(Vertex)

getEdges_internal

protected Collection getEdges_internal()
Returns a list of all incident edges of this vertex. Requires time proportional to the number of incident edges.

Overrides:
getEdges_internal in class SimpleUndirectedSparseVertex
See Also:
AbstractArchetypeVertex.getEdges_internal()

addNeighbor_internal

protected void addNeighbor_internal(Edge e,
                                    Vertex v)
Description copied from class: AbstractSparseVertex
Adds the specified edge e and vertex v to the internal data structures of this vertex.

Overrides:
addNeighbor_internal in class SimpleUndirectedSparseVertex
Parameters:
e - the new incident edge of this vertex
v - the new neighbor of this vertex
See Also:
AbstractSparseVertex.addNeighbor_internal(Edge, Vertex)

removeNeighbor_internal

protected void removeNeighbor_internal(Edge e,
                                       Vertex v)
Description copied from class: SimpleUndirectedSparseVertex
Removes the neighbor from this vertex's internal map.

Overrides:
removeNeighbor_internal in class SimpleUndirectedSparseVertex
Parameters:
e - the incident edge of this vertex which is being removed
v - the neighbor of this vertex which is being removed
See Also:
AbstractSparseVertex.removeNeighbor_internal(Edge, Vertex)