org.geotools.graph.structure
Interface Edge

All Superinterfaces:
Graphable
All Known Subinterfaces:
DirectedEdge
All Known Implementing Classes:
BasicDirectedEdge, BasicEdge, 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
See Also:
Node, Graph

Field Summary
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
 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 org.geotools.graph.structure.Graphable
getCount, getID, getObject, getRelated, isVisited, setCount, setID, setObject, setVisited
 

Field Detail

EQUAL_NODE_ORIENTATION

public static final int EQUAL_NODE_ORIENTATION
flag to indicate equal node orientation of two edges

See Also:
Constant Field Values

UNEQUAL_NODE_ORIENTATION

public static final int UNEQUAL_NODE_ORIENTATION
flag to indicate unequal node orientation of two edges

See Also:
Constant Field Values

OPPOSITE_NODE_ORIENTATION

public static final int OPPOSITE_NODE_ORIENTATION
flag to indicate opposite node orientation of two edges

See Also:
Constant Field Values
Method Detail

getNodeA

public Node getNodeA()
Returns the A node of the edge.

Returns:
The A node.

getNodeB

public Node getNodeB()
Returns the B node of the edge.

Returns:
The B node.

getOtherNode

public 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

public void reverse()
Reverses the node orientation of the edge.


compareNodes

public 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.


Copyright © GeoTools. All Rights Reserved.