public class Subgraph extends Object
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.
| Modifier and Type | Field and Description |
|---|---|
protected List |
dirEdges
|
protected Set |
edges
|
protected NodeMap |
nodeMap
|
protected PlanarGraph |
parentGraph
|
| Constructor and Description |
|---|
Subgraph(PlanarGraph
Creates a new subgraph of the given
PlanarGraph
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(Edge
Adds an
Edge to the subgraph.
|
boolean |
contains(Edge
Tests whether an
Edge is contained in this subgraph
|
Iterator |
dirEdgeIterator()
Returns an
Iterator over the
DirectedEdges in this graph, in the order in which they were added.
|
Iterator |
edgeIterator()
|
PlanarGraph |
getParent()
Gets the
PlanarGraph which this subgraph is part of.
|
Iterator |
nodeIterator()
|
protected PlanarGraphparentGraph
protected Setedges
protected ListdirEdges
protected NodeMapnodeMap
public Subgraph(PlanarGraphparentGraph)
PlanarGraph
parentGraph - the parent graph
public PlanarGraphgetParent()
PlanarGraph which this subgraph is part of.
public void add(Edgee)
e - the edge to add
public IteratordirEdgeIterator()
Iterator over the
DirectedEdges in this graph, in the order in which they were added.
add(Edge)
public IteratornodeIterator()