Package org.locationtech.jts.planargraph
Class Node
java.lang.Object
org.locationtech.jts.planargraph.GraphComponent
org.locationtech.jts.planargraph.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.- Version:
- 1.7
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected DirectedEdgeStar
The collection of DirectedEdges that leave this Nodeprotected Coordinate
The location of this NodeFields inherited from class org.locationtech.jts.planargraph.GraphComponent
isMarked, isVisited
-
Constructor Summary
ConstructorsConstructorDescriptionNode
(Coordinate pt) Constructs a Node with the given location.Node
(Coordinate pt, DirectedEdgeStar deStar) Constructs a Node with the given location and collection of outgoing DirectedEdges. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds an outgoing DirectedEdge to this Node.Returns the location of this Node.int
Returns the number of edges around this Node.static Collection
getEdgesBetween
(Node node0, Node node1) Returns all Edges that connect the two nodes (which are assumed to be different).int
Returns the zero-based index of the given Edge, after sorting in ascending order by angle with the positive x-axis.Returns the collection of DirectedEdges that leave this Node.boolean
Tests whether this node has been removed from its containing graph(package private) void
remove()
Removes this node from its containing graph.void
remove
(DirectedEdge de) Removes aDirectedEdge
incident on this node.Methods inherited from class org.locationtech.jts.planargraph.GraphComponent
getComponentWithVisitedState, getContext, getData, isMarked, isVisited, setContext, setData, setMarked, setMarked, setVisited, setVisited
-
Field Details
-
pt
The location of this Node -
deStar
The collection of DirectedEdges that leave this Node
-
-
Constructor Details
-
Node
Constructs a Node with the given location. -
Node
Constructs a Node with the given location and collection of outgoing DirectedEdges.
-
-
Method Details
-
getEdgesBetween
Returns all Edges that connect the two nodes (which are assumed to be different). -
getCoordinate
Returns the location of this Node. -
addOutEdge
Adds an outgoing DirectedEdge to this Node. -
getOutEdges
Returns the collection of DirectedEdges that leave this Node. -
getDegree
public int getDegree()Returns the number of edges around this Node. -
getIndex
Returns the zero-based index of the given Edge, after sorting in ascending order by angle with the positive x-axis. -
remove
Removes aDirectedEdge
incident on this node. Does not change the state of the directed edge. -
remove
void remove()Removes this node from its containing graph. -
isRemoved
public boolean isRemoved()Tests whether this node has been removed from its containing graph- Specified by:
isRemoved
in classGraphComponent
- Returns:
true
if this node is removed
-