org.geotools.graph.structure

Interface Edge

• All Superinterfaces:
Graphable
All Known Subinterfaces:
DirectedEdge
All Known Implementing Classes:
BasicDirectedEdge, BasicEdge, DelaunayEdge, OptDirectedEdge, OptEdge

public interface Edge
extends Graphable
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.
Author:
Justin Deoliveira, Refractions Research Inc, jdeolive@refractions.net
Node, Graph
• Field Detail

• EQUAL_NODE_ORIENTATION

static final int EQUAL_NODE_ORIENTATION
flag to indicate equal node orientation of two edges *
Constant Field Values
• UNEQUAL_NODE_ORIENTATION

static final int UNEQUAL_NODE_ORIENTATION
flag to indicate unequal node orientation of two edges *
Constant Field Values
• OPPOSITE_NODE_ORIENTATION

static final int OPPOSITE_NODE_ORIENTATION
flag to indicate opposite node orientation of two edges *
Constant Field Values
• Method Detail

• 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

Node getOtherNode(Node node)
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

int compareNodes(Edge other)
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.