Class Node
java.lang.Object
org.locationtech.jts.planargraph.GraphComponent
org.locationtech.jts.planargraph.Node
A node in a
PlanarGraphis a location where 0 or more Edges
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 DirectedEdgeStarThe collection of DirectedEdges that leave this Nodeprotected CoordinateThe location of this NodeFields inherited from class 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 TypeMethodDescriptionvoidAdds an outgoing DirectedEdge to this Node.Returns the location of this Node.intReturns the number of edges around this Node.static CollectiongetEdgesBetween(Node node0, Node node1) Returns all Edges that connect the two nodes (which are assumed to be different).intReturns 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.booleanTests whether this node has been removed from its containing graphvoidremove(DirectedEdge de) Removes aDirectedEdgeincident on this node.Methods inherited from class 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 aDirectedEdgeincident on this node. Does not change the state of the directed edge. -
isRemoved
public boolean isRemoved()Tests whether this node has been removed from its containing graph- Specified by:
isRemovedin classGraphComponent- Returns:
trueif this node is removed
-