com.vividsolutions.jts.planargraph
Class Node
A node in a
PlanarGraph
is a location where 0 or more
Edge
s
meet. A node is connected to each of its incident Edges via an outgoing
DirectedEdge. Some clients using a
PlanarGraph
may want to
subclass
Node
to add their own application-specific
data and methods.
deStar
protected DirectedEdgeStar deStar
The collection of DirectedEdges that leave this Node
pt
protected Coordinate pt
The location of this Node
Node
public Node(Coordinate pt)
Constructs a Node with the given location.
Node
public Node(Coordinate pt,
DirectedEdgeStar deStar)
Constructs a Node with the given location and collection of outgoing DirectedEdges.
addOutEdge
public void addOutEdge(DirectedEdge de)
Adds an outgoing DirectedEdge to this Node.
getCoordinate
public Coordinate getCoordinate()
Returns the location of this Node.
getDegree
public int getDegree()
Returns the number of edges around this Node.
getEdgesBetween
public static Collection getEdgesBetween(Node node0,
Node node1)
Returns all Edges that connect the two nodes (which are assumed to be different).
getIndex
public int getIndex(Edge edge)
Returns the zero-based index of the given Edge, after sorting in ascending order
by angle with the positive x-axis.
getOutEdges
public DirectedEdgeStar getOutEdges()
Returns the collection of DirectedEdges that leave this Node.