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

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.AbstractArchetypeEdge
              extended by edu.uci.ics.jung.graph.impl.AbstractHyperedge
All Implemented Interfaces:
ArchetypeEdge, Element, Hyperedge, UserDataContainer, Cloneable
Direct Known Subclasses:
CollectionHyperedge

public abstract class AbstractHyperedge
extends AbstractArchetypeEdge
implements Hyperedge

This class provides a skeletal implementation of the Hyperedge 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.

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

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
AbstractHyperedge()
           
 
Method Summary
 boolean connectVertex(Hypervertex hv1)
          Connects hv1 to this edge and vice versa.
 ArchetypeEdge copy(ArchetypeGraph newGraph)
          Creates a copy of this edge in the specified graph newGraph, and copies this edge's user data to the new edge.
 boolean disconnectVertex(Hypervertex hv1)
          Disconnects hv1 from this edge and vice versa.
 Set getIncidentVertices()
          Returns the set of vertices which are incident to this edge.
protected abstract  Collection getVertices_internal()
           
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.AbstractArchetypeEdge
equals, getEqualEdge, getEquivalentEdge, getIncidentElements, isIncident, numVertices
 
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.ArchetypeEdge
getEqualEdge, getEquivalentEdge, isIncident, numVertices
 
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

AbstractHyperedge

public AbstractHyperedge()
Method Detail

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

connectVertex

public boolean connectVertex(Hypervertex hv1)
Connects hv1 to this edge and vice versa. If hv1 is already incident to this edge, returns false; otherwise, returns true. Throws IllegalArgumentException if this edge is an orphan, or if hv1 is either an orphan or part of a different graph than this edge.

Specified by:
connectVertex in interface Hyperedge
See Also:
Hyperedge.connectVertex(edu.uci.ics.jung.graph.Hypervertex)

disconnectVertex

public boolean disconnectVertex(Hypervertex hv1)
Disconnects hv1 from this edge and vice versa. If hv1 is not incident to this edge, returns false; otherwise, returns true.

Specified by:
disconnectVertex in interface Hyperedge
See Also:
Hyperedge.disconnectVertex(edu.uci.ics.jung.graph.Hypervertex)

copy

public ArchetypeEdge copy(ArchetypeGraph newGraph)
Creates a copy of this edge in the specified graph newGraph, and copies this edge's user data to the new edge. Connects this

Specified by:
copy in interface ArchetypeEdge
Overrides:
copy in class AbstractArchetypeEdge
Parameters:
newGraph - the graph in which the copied edge will be placed
Returns:
the edge created
See Also:
ArchetypeEdge.copy(edu.uci.ics.jung.graph.ArchetypeGraph)

getIncidentVertices

public Set getIncidentVertices()
Description copied from interface: ArchetypeEdge
Returns the set of vertices which are incident to this edge. Each of the vertices returned should implement ArchetypeVertex. For example, returns the source and destination vertices of a directed edge.

Specified by:
getIncidentVertices in interface ArchetypeEdge
Returns:
the vertices incident to this edge
See Also:
ArchetypeEdge.getIncidentVertices()

toString

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

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

getVertices_internal

protected abstract Collection getVertices_internal()