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 Point |
pt
The location of this Node
|
isMarked, isVisited| Constructor and Description |
|---|
Node(Point pt)
Constructs a Node with the given location.
|
Node(Point pt,
DirectedEdgeStar deStar)
Constructs a Node with the given location and collection of outgoing DirectedEdges.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addOutEdge(DirectedEdge de)
Adds an outgoing DirectedEdge to this Node.
|
Point |
getCoordinate()
Returns the location of this Node.
|
int |
getDegree()
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 |
getIndex(Edge 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 de)
Removes a
DirectedEdge incident on this node. |
getComponentWithVisitedState, getContext, getData, isMarked, isVisited, setContext, setData, setMarked, setMarked, setVisited, setVisitedprotected Point pt
protected DirectedEdgeStar deStar
public Node(Point pt)
public Node(Point pt, DirectedEdgeStar deStar)
public static Collection getEdgesBetween(Node node0, Node node1)
public void addOutEdge(DirectedEdge de)
public Point getCoordinate()
public int getDegree()
public int getIndex(Edge edge)
public DirectedEdgeStar getOutEdges()
public boolean isRemoved()
isRemoved in class GraphComponenttrue if this node is removedpublic void remove(DirectedEdge de)
DirectedEdge incident on this node.
Does not change the state of the directed edge.Copyright © 2015 Revolution Systems Inc.. All rights reserved.