|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.vividsolutions.jts.planargraph.PlanarGraph
Represents a directed graph which is embeddable in a planar surface.
This class and the other classes in this package serve as a framework for
building planar graphs for specific algorithms. This class must be
subclassed to expose appropriate methods to construct the graph. This allows
controlling the types of graph components (DirectedEdge
s,
Edge
s and Node
s) which can be added to the graph. An
application which uses the graph framework will almost always provide
subclasses for one or more graph components, which hold application-specific
data and graph algorithms.
Field Summary | |
protected java.util.List |
dirEdges
|
protected java.util.List |
edges
|
protected NodeMap |
nodeMap
|
Constructor Summary | |
PlanarGraph()
Constructs a PlanarGraph without any Edges, DirectedEdges, or Nodes. |
Method Summary | |
protected void |
add(DirectedEdge dirEdge)
Adds the Edge to this PlanarGraph; only subclasses can add DirectedEdges, to ensure the edges added are of the right class. |
protected void |
add(Edge edge)
Adds the Edge and its DirectedEdges with this PlanarGraph. |
protected void |
add(Node node)
Adds a node to the map, replacing any that is already at that location. |
java.util.Iterator |
dirEdgeIterator()
Returns an Iterator over the DirectedEdges in this PlanarGraph, in the order in which they were added. |
java.util.Iterator |
edgeIterator()
Returns an Iterator over the Edges in this PlanarGraph, in the order in which they were added. |
Node |
findNode(Coordinate pt)
Returns the Node at the given location, or null if no Node was there. |
java.util.List |
findNodesOfDegree(int degree)
Returns all Nodes with the given number of Edges around it. |
java.util.List |
getEdges()
Returns the Edges that have been added to this PlanarGraph |
java.util.Collection |
getNodes()
Returns the Nodes in this PlanarGraph. |
java.util.Iterator |
nodeIterator()
Returns an Iterator over the Nodes in this PlanarGraph. |
void |
remove(DirectedEdge de)
Removes DirectedEdge from its from-Node and from this PlanarGraph. |
void |
remove(Edge edge)
Removes an Edge and its associated DirectedEdges from their from-Nodes and from this PlanarGraph. |
void |
remove(Node node)
Removes a node from the graph, along with any associated DirectedEdges and Edges. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected java.util.List edges
protected java.util.List dirEdges
protected NodeMap nodeMap
Constructor Detail |
public PlanarGraph()
Method Detail |
public Node findNode(Coordinate pt)
protected void add(Node node)
protected void add(Edge edge)
protected void add(DirectedEdge dirEdge)
public java.util.Iterator nodeIterator()
public java.util.Collection getNodes()
public java.util.Iterator dirEdgeIterator()
add(Edge)
,
add(DirectedEdge)
public java.util.Iterator edgeIterator()
add(Edge)
public java.util.List getEdges()
add(Edge)
public void remove(Edge edge)
public void remove(DirectedEdge de)
public void remove(Node node)
public java.util.List findNodesOfDegree(int degree)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |