edu.uci.ics.jung.graph.impl
Class AbstractHyperedge
java.lang.Object
edu.uci.ics.jung.utils.UserDataDelegate
edu.uci.ics.jung.graph.impl.AbstractElement
edu.uci.ics.jung.graph.impl.AbstractArchetypeEdge
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
AbstractHyperedge
public AbstractHyperedge()
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()