public class Node extends GraphComponent
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.
| Modifier and Type | Field and Description |
|---|---|
protected DirectedEdgeStar |
deStar
The collection of DirectedEdges that leave this Node
|
protected Coordinate |
pt
The location of this Node
|
isMarked, isVisited| Constructor and Description |
|---|
Node(Coordinate
Constructs a Node with the given location.
|
Node(Coordinate
Constructs a Node with the given location and collection of outgoing DirectedEdges.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addOutEdge(DirectedEdge
Adds an outgoing DirectedEdge to this Node.
|
Coordinate |
getCoordinate()
Returns the location of this Node.
|
int |
getDegree()
Returns the number of edges around this Node.
|
static Collection |
getEdgesBetween(Node
Returns all Edges that connect the two nodes (which are assumed to be different).
|
int |
getIndex(Edge
Returns the zero-based index of the given Edge, after sorting in ascending order by angle with the positive x-axis.
|
DirectedEdgeStar |
getOutEdges()
Returns the collection of DirectedEdges that leave this Node.
|
boolean |
isRemoved()
Tests whether this node has been removed from its containing graph
|
void |
remove(DirectedEdge
Removes a
DirectedEdge incident on this node.
|
getComponentWithVisitedState, getContext, getData, isMarked, isVisited, setContext, setData, setMarked, setMarked, setVisited, setVisitedprotected Coordinatept
protected DirectedEdgeStardeStar
public Node(Coordinatept)
public Node(Coordinatept, DirectedEdgeStar deStar)
public static CollectiongetEdgesBetween(Node node0, Node node1)
public CoordinategetCoordinate()
public void addOutEdge(DirectedEdgede)
public DirectedEdgeStargetOutEdges()
public int getDegree()
public int getIndex(Edgeedge)
public void remove(DirectedEdgede)
DirectedEdge incident on this node. Does not change the state of the directed edge.
public boolean isRemoved()
isRemoved in class
GraphComponent
true if this node is removed