Class BasicEdge
Object
BasicGraphable
BasicEdge
- All Implemented Interfaces:
Serializable
,Edge
,Graphable
- Direct Known Subclasses:
DelaunayEdge
Basic implementation of Edge.
- Author:
- Justin Deoliveira, Refractions Research Inc, jdeolive@refractions.net
- See Also:
-
Field Summary
Fields inherited from interface Edge
EQUAL_NODE_ORIENTATION, OPPOSITE_NODE_ORIENTATION, UNEQUAL_NODE_ORIENTATION
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
compareNodes
(Edge other) Compares the node orientation of the edge with another edge.getNodeA()
Returns the A node of the edge.getNodeB()
Returns the B node of the edge.getOtherNode
(Node node) Returns null if the specified node is neither the A node or the B node.Returns all edges that are adjacent to both the A and B nodes.void
reverse()
Reverses the node orientation of the edge.toString()
Returns ([A node.toString()],[B node.toString()]).Methods inherited from class BasicGraphable
getCount, getID, getObject, isVisited, setCount, setID, setObject, setVisited
-
Constructor Details
-
BasicEdge
Constructs a new edge.- Parameters:
nodeA
- A node of edge.nodeB
- B node of edge.
-
-
Method Details
-
getNodeA
Description copied from interface:Edge
Returns the A node of the edge. -
getNodeB
Description copied from interface:Edge
Returns the B node of the edge. -
getOtherNode
Returns null if the specified node is neither the A node or the B node.- Specified by:
getOtherNode
in 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:
-
getRelated
Returns all edges that are adjacent to both the A and B nodes. This iterator is generated by calculating an underlying collection upon each method call.- Specified by:
getRelated
in interfaceGraphable
- Returns:
- Iterator An iterator over other components of the graph that are related to the component.
- See Also:
-
reverse
public void reverse()Description copied from interface:Edge
Reverses the node orientation of the edge. -
compareNodes
Description copied from interface:Edge
Compares the node orientation of the edge with another edge.- Specified by:
compareNodes
in 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:
-
toString
Returns ([A node.toString()],[B node.toString()]).- Overrides:
toString
in classBasicGraphable
- See Also:
-