org.geotools.graph.structure.opt
Class OptDirectedEdge

java.lang.Object
  extended byorg.geotools.graph.structure.opt.OptGraphable
      extended byorg.geotools.graph.structure.opt.OptDirectedEdge
All Implemented Interfaces:
DirectedEdge, DirectedGraphable, Edge, Graphable, java.io.Serializable

public class OptDirectedEdge
extends OptGraphable
implements DirectedEdge

Optimized implementation of DirectedEdge.

Author:
Justin Deoliveira, Refractions Research Inc, jdeolive@refractions.net
See Also:
DirectedEdge, Serialized Form

Nested Class Summary
 class OptDirectedEdge.RelatedIterator
          Iterator used to iterate over adjacent edges.
 
Field Summary
 
Fields inherited from interface org.geotools.graph.structure.Edge
EQUAL_NODE_ORIENTATION, OPPOSITE_NODE_ORIENTATION, UNEQUAL_NODE_ORIENTATION
 
Constructor Summary
OptDirectedEdge(OptDirectedNode in, OptDirectedNode out)
          Constructs a new OptDirectedEdge.
 
Method Summary
 int compareNodes(Edge other)
          Compares the node orientation of the edge with another edge.
 DirectedNode getInNode()
          Returns the originating (in) node of the edge.
 java.util.Iterator getInRelated()
          Returns other components related through an in relationship.
 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.
 DirectedNode getOutNode()
          Returns the terminating (out) node of the edge.
 java.util.Iterator getOutRelated()
          Returns other components related through an out relationship.
 java.util.Iterator getRelated()
          Returns an iterator over any related components.
 void reverse()
          Unsupported Operation.
 
Methods inherited from class org.geotools.graph.structure.opt.OptGraphable
getCount, getID, getObject, isVisited, setCount, setID, setObject, setVisited
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.geotools.graph.structure.Graphable
getCount, getID, getObject, isVisited, setCount, setID, setObject, setVisited
 

Constructor Detail

OptDirectedEdge

public OptDirectedEdge(OptDirectedNode in,
                       OptDirectedNode out)
Constructs a new OptDirectedEdge.

Parameters:
in - Optimized in node.
out - Optimized out node.
Method Detail

getInNode

public DirectedNode getInNode()
Description copied from interface: DirectedEdge
Returns the originating (in) node of the edge.

Specified by:
getInNode in interface DirectedEdge
Returns:
The directed node at the source of the edge.
See Also:
DirectedEdge.getInNode()

getOutNode

public DirectedNode getOutNode()
Description copied from interface: DirectedEdge
Returns the terminating (out) node of the edge.

Specified by:
getOutNode in interface DirectedEdge
Returns:
The directed node at the destination of the edge.
See Also:
DirectedEdge.getOutNode()

getNodeA

public Node getNodeA()
Description copied from interface: Edge
Returns the A node of the edge.

Specified by:
getNodeA in interface Edge
Returns:
The A node.
See Also:
Edge.getNodeA()

getNodeB

public Node getNodeB()
Description copied from interface: Edge
Returns the B node of the edge.

Specified by:
getNodeB in interface Edge
Returns:
The B node.
See Also:
Edge.getNodeB()

getOtherNode

public Node getOtherNode(Node node)
Description copied from interface: Edge
Returns one of the two nodes of an edge. If the specified node is node A, then node B is returned, and vice versa.

Specified by:
getOtherNode in interface Edge
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.
See Also:
Edge.getOtherNode(Node)

reverse

public void reverse()
Unsupported Operation.

Specified by:
reverse in interface Edge
Throws:
java.lang.UnsupportedOperationException

compareNodes

public int compareNodes(Edge other)
Description copied from interface: Edge
Compares the node orientation of the edge with another edge.

Specified by:
compareNodes in interface 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.
See Also:
Edge.compareNodes(Edge)

getRelated

public java.util.Iterator getRelated()
Description copied from interface: Graphable
Returns an iterator over any related components. A graph component is related to other components of the graph of similary type through some relationship.

Specified by:
getRelated in interface Graphable
Returns:
Iterator An iterator over other components of the graph that are related to the component.
See Also:
Graphable.getRelated()

getInRelated

public java.util.Iterator getInRelated()
Description copied from interface: DirectedGraphable
Returns other components related through an in relationship.

Specified by:
getInRelated in interface DirectedGraphable
Returns:
An iterator over the other directed components related through an in relationship.
See Also:
DirectedGraphable.getInRelated()

getOutRelated

public java.util.Iterator getOutRelated()
Description copied from interface: DirectedGraphable
Returns other components related through an out relationship.

Specified by:
getOutRelated in interface DirectedGraphable
Returns:
An iterator over the other directed components related through an out relationship.
See Also:
DirectedGraphable.getOutRelated()


Copyright © GeoTools. All Rights Reserved.