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

java.lang.Object
  extended byedu.uci.ics.jung.utils.UserData
      extended byedu.uci.ics.jung.graph.impl.AbstractSparseEdge
          extended byedu.uci.ics.jung.graph.impl.UndirectedSparseEdge
              extended byedu.uci.ics.jung.graph.impl.BipartiteEdge
All Implemented Interfaces:
ArchetypeEdge, java.lang.Cloneable, Edge, UndirectedEdge, UserDataContainer
Direct Known Subclasses:
BipartiteGraphCollapser.CollapsedBipartiteEdge

public class BipartiteEdge
extends UndirectedSparseEdge

A simple extension of the UndirectedSparseEdge, except with careful bounds checking. The constructor throws a FatalException if its vertices are not in two classes of a BipartiteGraph. (In fact, the Vertices must come in the order CLASSA, CLASSB).

Author:
danyelf

Nested Class Summary
 
Nested classes inherited from class edu.uci.ics.jung.utils.UserDataContainer
UserDataContainer.CopyAction
 
Field Summary
 
Fields inherited from class edu.uci.ics.jung.utils.UserData
CLONE, REMOVE, SHARED
 
Constructor Summary
BipartiteEdge(BipartiteVertex a, BipartiteVertex b)
          The BipartiteEdge constructor.
 
Method Summary
 ArchetypeEdge copy(ArchetypeGraph newGraph)
          Creates a copy of this edge in graph g.
 
Methods inherited from class edu.uci.ics.jung.graph.impl.AbstractSparseEdge
equals, getEndpoints, getEqualEdge, getEquivalentEdge, getGraph, getIncidentVertices, getOpposite, hashCode, isIncident, numVertices, toString
 
Methods inherited from class edu.uci.ics.jung.utils.UserData
addUserDatum, containsUserDatumKey, getUserDatum, getUserDatumCopyAction, getUserDatumKeyIterator, importUserData, removeUserDatum, setUserDatum
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface edu.uci.ics.jung.graph.Edge
getEndpoints, getOpposite
 
Methods inherited from interface edu.uci.ics.jung.graph.ArchetypeEdge
getEqualEdge, getEquivalentEdge, getGraph, getIncidentVertices, isIncident, numVertices
 
Methods inherited from interface edu.uci.ics.jung.utils.UserDataContainer
addUserDatum, containsUserDatumKey, getUserDatum, getUserDatumCopyAction, getUserDatumKeyIterator, importUserData, removeUserDatum, setUserDatum
 

Constructor Detail

BipartiteEdge

public BipartiteEdge(BipartiteVertex a,
                     BipartiteVertex b)
The BipartiteEdge constructor.

Parameters:
a - a Vertex from a BipartiteGraph in CLASSA
b - a Vertex from the same BipartiteGraph in CLASSB
Method Detail

copy

public ArchetypeEdge copy(ArchetypeGraph newGraph)
Description copied from interface: ArchetypeEdge
Creates a copy of this edge in graph g. 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.

Specified by:
copy in interface ArchetypeEdge
Overrides:
copy in class AbstractSparseEdge
See Also:
ArchetypeEdge.copy(edu.uci.ics.jung.graph.ArchetypeGraph)