Package org.geotools.graph.structure.opt
Class OptEdge
- Object
-
- OptGraphable
-
- OptEdge
-
- All Implemented Interfaces:
Serializable,Edge,Graphable
public class OptEdge extends OptGraphable implements Edge
Optimized implementation of Edge.- Author:
- Justin Deoliveira, Refractions Research Inc, jdeolive@refractions.net
- See Also:
Edge, Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classOptEdge.RelatedIterator
-
Field Summary
-
Fields inherited from interface Edge
EQUAL_NODE_ORIENTATION, OPPOSITE_NODE_ORIENTATION, UNEQUAL_NODE_ORIENTATION
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareNodes(Edge other)Compares the node orientation of the edge with another edge.NodegetNodeA()Returns the A node of the edge.NodegetNodeB()Returns the B node of the edge.NodegetOtherNode(Node node)Returns one of the two nodes of an edge.Iterator<Edge>getRelated()Returns an iterator over any related components.voidreverse()Reverses the node orientation of the edge.-
Methods inherited from class OptGraphable
getCount, getID, getObject, isVisited, setCount, setID, setObject, setVisited
-
-
-
-
Method Detail
-
getNodeA
public Node getNodeA()
Description copied from interface:EdgeReturns the A node of the edge.- Specified by:
getNodeAin interfaceEdge- Returns:
- The A node.
- See Also:
Edge.getNodeA()
-
getNodeB
public Node getNodeB()
Description copied from interface:EdgeReturns the B node of the edge.- Specified by:
getNodeBin interfaceEdge- Returns:
- The B node.
- See Also:
Edge.getNodeB()
-
getOtherNode
public Node getOtherNode(Node node)
Description copied from interface:EdgeReturns 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:
getOtherNodein interfaceEdge- 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()
Description copied from interface:EdgeReverses the node orientation of the edge.- Specified by:
reversein interfaceEdge- See Also:
Edge.reverse()
-
compareNodes
public int compareNodes(Edge other)
Description copied from interface:EdgeCompares the node orientation of the edge with another edge.- Specified by:
compareNodesin interfaceEdge- 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 Iterator<Edge> getRelated()
Description copied from interface:GraphableReturns 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:
getRelatedin interfaceGraphable- Returns:
- Iterator An iterator over other components of the graph that are related to the component.
- See Also:
Graphable.getRelated()
-
-