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

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.AbstractHypervertex
All Implemented Interfaces:
ArchetypeVertex, Element, Hypervertex, UserDataContainer, Cloneable
Direct Known Subclasses:
CollectionHypervertex

public abstract class AbstractHypervertex
extends AbstractArchetypeVertex
implements Hypervertex

This class provides a skeletal implementation of the Hypervertex interface to minimize the effort required to implement this interface.

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.

Existing subclasses maintain collections of edges, and infer neighbor collections from these classes. Independent neighbor collections are difficult to maintain for the following reasons:

  1. Hyperedges' membership is mutable; when a vertex is added to or removed from a hyperedge, each vertex connected to the hyperedge must be notified of the change, and when a hyperedge is added to or removed from a graph, each connected vertex must remove all vertices incident to this edge from its collections...but only if there are no other edges connecting each vertex pair.
  2. The number of "neighboring" vertices for a hypergraph can be very large if it is connected to several hyperedges. Those who want to provide implementations which maintain something like the adjacency maps found in the Vertex implementations will need to provide support for edge set mutability both in the Hypervertex implementation and in the Hyperedge implementation.

Author:
Joshua O'Madadhain, Joshua O'Madadhain
See Also:
SetHypergraph, AbstractHyperedge

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
AbstractHypervertex()
           
 
Method Summary
 boolean connectEdge(Hyperedge e)
          Connects he to this hypervertex and vice versa.
 ArchetypeVertex copy(ArchetypeGraph g)
          Creates a copy of this vertex in graph g.
 boolean disconnectEdge(Hyperedge e)
          Disconnects he from this hypervertex and vice versa.
protected  void initialize()
          Initializes all the data structures for this element.
 String toString()
          Returns a human-readable representation of this edge.
 
Methods inherited from class edu.uci.ics.jung.graph.impl.AbstractArchetypeVertex
degree, equals, findEdge, findEdgeSet, getEdges_internal, getEqualVertex, getEquivalentVertex, getIncidentEdges, getIncidentElements, getNeighbors_internal, 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, findEdge, findEdgeSet, 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

AbstractHypervertex

public AbstractHypervertex()
Method Detail

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
Overrides:
copy in class AbstractArchetypeVertex
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)

initialize

protected void initialize()
Description copied from class: AbstractElement
Initializes all the data structures for this element. (This is used on cloned elements, since clone() copies some information that should not be in the new element.)

Overrides:
initialize in class AbstractElement

toString

public String toString()
Returns a human-readable representation of this edge.

Overrides:
toString in class Object
See Also:
Object.toString()

connectEdge

public boolean connectEdge(Hyperedge e)
Description copied from interface: Hypervertex
Connects he to this hypervertex and vice versa. Does not affect he's membership in the graph. Equivalent to calling he.connectVertex(this).

Specified by:
connectEdge in interface Hypervertex
See Also:
Hypervertex.connectEdge(Hyperedge)

disconnectEdge

public boolean disconnectEdge(Hyperedge e)
Description copied from interface: Hypervertex
Disconnects he from this hypervertex and vice versa. Does not affect he's membership in the graph. Equivalent to calling he.disconnectVertex(this).

Specified by:
disconnectEdge in interface Hypervertex
See Also:
Hypervertex.disconnectEdge(Hyperedge)