Package org.locationtech.jts.planargraph
Class Subgraph
java.lang.Object
org.locationtech.jts.planargraph.Subgraph
A subgraph of a
PlanarGraph
.
A subgraph may contain any subset of Edge
s
from the parent graph.
It will also automatically contain all DirectedEdge
s
and Node
s associated with those edges.
No new objects are created when edges are added -
all associated components must already exist in the parent graph.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected List
protected Set
protected NodeMap
protected PlanarGraph
-
Constructor Summary
ConstructorsConstructorDescriptionSubgraph
(PlanarGraph parentGraph) Creates a new subgraph of the givenPlanarGraph
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds anEdge
to the subgraph.boolean
Tests whether anEdge
is contained in this subgraphReturns anIterator
over theDirectedEdge
s in this graph, in the order in which they were added.Gets thePlanarGraph
which this subgraph is part of.
-
Field Details
-
parentGraph
-
edges
-
dirEdges
-
nodeMap
-
-
Constructor Details
-
Subgraph
Creates a new subgraph of the givenPlanarGraph
- Parameters:
parentGraph
- the parent graph
-
-
Method Details
-
getParent
Gets thePlanarGraph
which this subgraph is part of.- Returns:
- the parent PlanarGraph
-
add
- Parameters:
e
- the edge to add
-
dirEdgeIterator
Returns anIterator
over theDirectedEdge
s in this graph, in the order in which they were added.- Returns:
- an iterator over the directed edges
- See Also:
-
edgeIterator
- Returns:
- an iterator over the edges
- See Also:
-
nodeIterator
- Returns:
- an iterator over the nodes
-
contains
Tests whether anEdge
is contained in this subgraph- Parameters:
e
- the edge to test- Returns:
true
if the edge is contained in this subgraph
-