Package 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.
-
-
Field Summary
Fields Modifier and Type Field Description static int
EQUAL_NODE_ORIENTATION
flag to indicate equal node orientation of two edges *static int
OPPOSITE_NODE_ORIENTATION
flag to indicate opposite node orientation of two edges *static int
UNEQUAL_NODE_ORIENTATION
flag to indicate unequal node orientation of two edges *
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description int
compareNodes(Edge other)
Compares the node orientation of the edge with another edge.Node
getNodeA()
Returns the A node of the edge.Node
getNodeB()
Returns the B node of the edge.Node
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 Detail
-
EQUAL_NODE_ORIENTATION
static final int EQUAL_NODE_ORIENTATION
flag to indicate equal node orientation of two edges *- See Also:
- Constant Field Values
-
UNEQUAL_NODE_ORIENTATION
static final int UNEQUAL_NODE_ORIENTATION
flag to indicate unequal node orientation of two edges *- See Also:
- Constant Field Values
-
OPPOSITE_NODE_ORIENTATION
static final int OPPOSITE_NODE_ORIENTATION
flag to indicate opposite node orientation of two edges *- See Also:
- 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.
-
-