Package org.geotools.graph.structure
Interface Edge
- All Superinterfaces:
Graphable
- All Known Subinterfaces:
DirectedEdge
- All Known Implementing Classes:
BasicDirectedEdge
,BasicEdge
,DelaunayEdge
,OptDirectedEdge
,OptEdge
Represents an edge in Graph. An edge is an arc in a graph which connects exactly two nodes. These two nodes are
referred to as the A node and the B node of the edge. The order of the A node and the B node is refered to as the
node orientation of the edge.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
flag to indicate equal node orientation of two edges *static final int
flag to indicate opposite node orientation of two edges *static final int
flag to indicate unequal node orientation of two edges * -
Method Summary
Modifier and TypeMethodDescriptionint
compareNodes
(Edge other) Compares the node orientation of the edge with another edge.getNodeA()
Returns the A node of the edge.getNodeB()
Returns the B node of the edge.getOtherNode
(Node node) Returns one of the two nodes of an edge.void
reverse()
Reverses the node orientation of the edge.Methods inherited from interface Graphable
getCount, getID, getObject, getRelated, isVisited, setCount, setID, setObject, setVisited
-
Field Details
-
EQUAL_NODE_ORIENTATION
static final int EQUAL_NODE_ORIENTATIONflag to indicate equal node orientation of two edges *- See Also:
-
UNEQUAL_NODE_ORIENTATION
static final int UNEQUAL_NODE_ORIENTATIONflag to indicate unequal node orientation of two edges *- See Also:
-
OPPOSITE_NODE_ORIENTATION
static final int OPPOSITE_NODE_ORIENTATIONflag to indicate opposite node orientation of two edges *- See Also:
-
-
Method Details
-
getNodeA
Node getNodeA()Returns the A node of the edge.- Returns:
- The A node.
-
getNodeB
Node getNodeB()Returns the B node of the edge.- Returns:
- The B node.
-
getOtherNode
Returns one of the two nodes of an edge. If the specified node is node A, then node B is returned, and vice versa.- Parameters:
node
- The node opposite of the node to return.- Returns:
- Node A if node B is specified, node B if node A is specified.
-
reverse
void reverse()Reverses the node orientation of the edge. -
compareNodes
Compares the node orientation of the edge with another edge.- Returns:
- EQUAL_NODE_ORIENTATION : both nodes are equal in the correct order. UNEQUAL_NODE_ORIENTATION: both nodes are not equal OPPOSITE_NODE_ORIENTATION : both nodes are equal in opposite order.
-