public abstract class AbstractArchetypeEdge extends AbstractElement implements ArchetypeEdge
UserDataContainer.CopyActionid, m_Graphfactory, udc_delegate| Constructor and Description |
|---|
AbstractArchetypeEdge() |
| Modifier and Type | Method and Description |
|---|---|
ArchetypeEdge |
copy(ArchetypeGraph g)
Creates a copy of this edge in graph
g. |
boolean |
equals(java.lang.Object o)
Returns
true if o is an instance of
ArchetypeEdge that is equivalent to this edge. |
ArchetypeEdge |
getEqualEdge(ArchetypeGraph ag)
Returns the edge in graph
g, if any,
that is equivalent to this edge. |
ArchetypeEdge |
getEquivalentEdge(ArchetypeGraph ag)
Deprecated.
As of version 1.4, renamed to getEqualEdge(ag).
|
java.util.Set |
getIncidentElements()
Returns the set of elements that are incident to this element.
|
boolean |
isIncident(ArchetypeVertex v)
Returns
true if the specified vertex v
is incident to this edge, and false otherwise. |
int |
numVertices()
Returns the number of vertices which are incident to this edge.
|
addGraph_internal, getGraph, hashCode, initialize, removeGraph_internaladdUserDatum, clone, containsUserDatumKey, getUserDatum, getUserDatumCopyAction, getUserDatumKeyIterator, importUserData, removeUserDatum, setUserDataFactory, setUserDatumfinalize, getClass, notify, notifyAll, toString, wait, wait, waitgetIncidentVerticesaddUserDatum, clone, containsUserDatumKey, getUserDatum, getUserDatumCopyAction, getUserDatumKeyIterator, importUserData, removeUserDatum, setUserDatumpublic java.util.Set getIncidentElements()
ElementgetIncidentElements in interface Elementpublic ArchetypeEdge getEqualEdge(ArchetypeGraph ag)
ArchetypeEdgeg, if any,
that is equivalent to this edge.
Two edges are equivalent if one of them is an ancestor
(via copy()) of the other.getEqualEdge in interface ArchetypeEdgeArchetypeEdge.getEqualEdge(edu.uci.ics.jung.graph.ArchetypeGraph)public ArchetypeEdge getEquivalentEdge(ArchetypeGraph ag)
getEquivalentEdge in interface ArchetypeEdgepublic int numVertices()
ArchetypeEdgenumVertices in interface ArchetypeEdgeArchetypeEdge.numVertices()public boolean isIncident(ArchetypeVertex v)
ArchetypeEdgetrue if the specified vertex v
is incident to this edge, and false otherwise.
The behavior of this method is undefined if v is not
an element of this edge's graph.isIncident in interface ArchetypeEdgeArchetypeEdge.isIncident(edu.uci.ics.jung.graph.ArchetypeVertex)public ArchetypeEdge copy(ArchetypeGraph g)
ArchetypeEdgeg. The edge created
will be equivalent to this edge: given e = this.copy(g),
then this.getEquivalentEdge(g) == e,
and this.equals(e) == true.
Given the set
of vertices S that are incident to this edge, the copied edge will be
made incident to the set of vertices S' in g that are
equivalent to S. S must be copied into g before
this edge can be copied into g. If there is no
such set of vertices in g,
this method throws IllegalArgumentException.
Thus, for example, given the following code:
Graph g1 = new Graph();
Vertex v1 = g1.addVertex(new DirectedSparseVertex());
Vertex v2 = g1.addVertex(new DirectedSparseVertex());
...
Edge e = g1.addEdge(new DirectedSparseEdge(v1, v2));
Vertex v3 = v1.getEquivalentVertex(g2);
Vertex v4 = v2.getEquivalentVertex(g2);
then e.copy(g2) will create a directed edge
connecting v3 to v4
in g2.copy in interface ArchetypeEdgeg - the graph in which the copied edge will be placedArchetypeEdge.copy(edu.uci.ics.jung.graph.ArchetypeGraph)public boolean equals(java.lang.Object o)
true if o is an instance of
ArchetypeEdge that is equivalent to this edge.
Respects the edge
equivalences which are established by copy() and
referenced by getEquivalentEdge().equals in class java.lang.ObjectObject.equals(java.lang.Object),
ArchetypeEdge.getEqualEdge(ArchetypeGraph),
ArchetypeEdge.copy(edu.uci.ics.jung.graph.ArchetypeGraph)