Class Subgraph

Hierarchy: Object , Subgraph
public class Subgraph
A subgraph of a PlanarGraph. A subgraph may contain any subset of Edges from the parent graph. It will also automatically contain all DirectedEdges and Nodes associated with those edges. No new objects are created when edges are added - all associated components must already exist in the parent graph.
public Subgraph(PlanarGraph parentGraph)
Creates a new subgraph of the given PlanarGraph
Parameters:
parentGraph - parentGraph the parent graph
public PlanarGraph getParent()
Gets the PlanarGraph which this subgraph is part of.
Returns:
the parent PlanarGraph
public void add(Edge e)
Adds an Edge to the subgraph. The associated DirectedEdges and Nodes are also added.
Parameters:
e - e the edge to add
public Iterator dirEdgeIterator()
Returns an Iterator over the DirectedEdges in this graph, in the order in which they were added.
See also:
#add(Edge)
Returns:
an iterator over the directed edges
public Iterator edgeIterator()
Returns an Iterator over the Edges in this graph, in the order in which they were added.
See also:
#add(Edge)
Returns:
an iterator over the edges
public Iterator nodeIterator()
Returns an Iterator over the Nodes in this graph.
Returns:
an iterator over the nodes
public boolean contains(Edge e)
Tests whether an Edge is contained in this subgraph
Parameters:
e - e the edge to test
Returns:
true if the edge is contained in this subgraph