public abstract class AbstractHyperedge extends AbstractArchetypeEdge implements Hyperedge
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.
SetHypergraph
,
AbstractHypervertex
UserDataContainer.CopyAction
id, m_Graph
factory, udc_delegate
Constructor and Description |
---|
AbstractHyperedge() |
Modifier and Type | Method and Description |
---|---|
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. |
java.util.Set |
getIncidentVertices()
Returns the set of vertices which are incident to this edge.
|
protected abstract java.util.Collection |
getVertices_internal() |
protected void |
initialize()
Initializes all the data structures for this element.
|
java.lang.String |
toString()
Returns a human-readable representation of this edge.
|
equals, getEqualEdge, getEquivalentEdge, getIncidentElements, isIncident, numVertices
addGraph_internal, getGraph, hashCode, removeGraph_internal
addUserDatum, clone, containsUserDatumKey, getUserDatum, getUserDatumCopyAction, getUserDatumKeyIterator, importUserData, removeUserDatum, setUserDataFactory, setUserDatum
finalize, getClass, notify, notifyAll, wait, wait, wait
getEqualEdge, getEquivalentEdge, isIncident, numVertices
getGraph, getIncidentElements
addUserDatum, clone, containsUserDatumKey, getUserDatum, getUserDatumCopyAction, getUserDatumKeyIterator, importUserData, removeUserDatum, setUserDatum
protected void initialize()
AbstractElement
clone()
copies some information that should
not be in the new element.)initialize
in class AbstractElement
public boolean connectVertex(Hypervertex hv1)
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.connectVertex
in interface Hyperedge
Hyperedge.connectVertex(edu.uci.ics.jung.graph.Hypervertex)
public boolean disconnectVertex(Hypervertex hv1)
hv1
from this edge and vice versa. If hv1
is not
incident to this edge, returns false
; otherwise, returns true
.disconnectVertex
in interface Hyperedge
Hyperedge.disconnectVertex(edu.uci.ics.jung.graph.Hypervertex)
public ArchetypeEdge copy(ArchetypeGraph newGraph)
newGraph
,
and copies this edge's user data to the new edge. Connects thiscopy
in interface ArchetypeEdge
copy
in class AbstractArchetypeEdge
newGraph
- the graph in which the copied edge will be placedArchetypeEdge.copy(edu.uci.ics.jung.graph.ArchetypeGraph)
public java.util.Set getIncidentVertices()
ArchetypeEdge
ArchetypeVertex
.
For example, returns the source and destination vertices of a
directed edge.getIncidentVertices
in interface ArchetypeEdge
ArchetypeEdge.getIncidentVertices()
public java.lang.String toString()
toString
in class java.lang.Object
Object.toString()
protected abstract java.util.Collection getVertices_internal()