uk.ed.inf.graph.directed
Interface IDirectedPair<N extends IDirectedNode<N,? extends IDirectedEdge<N,?>>,E extends IDirectedEdge<N,E>>

All Superinterfaces:
IBasicPair<N,E>
All Known Implementing Classes:
BaseCompoundNodePair, CompoundNodePair

public interface IDirectedPair<N extends IDirectedNode<N,? extends IDirectedEdge<N,?>>,E extends IDirectedEdge<N,E>>
extends IBasicPair<N,E>


Method Summary
 N getInNode()
          Get the node to which the end goes into.
 N getOutNode()
          Get the node to which the end comes from.
 boolean hasDirectedEnds(N outNode, N inNode)
          Tests if the ends exist in this directed pair.
 IDirectedPair<N,E> reversedNodes()
          Create a new node pair, with the nodes reversed as if this edge was pointing in the other direction.
 
Methods inherited from interface uk.ed.inf.graph.basic.IBasicPair
containsNode, equals, getOtherNode, hasEnds, hashCode
 

Method Detail

hasDirectedEnds

boolean hasDirectedEnds(N outNode,
                        N inNode)
Tests if the ends exist in this directed pair. Takes into account the direction of the ends so the reciprocal operations will not be equivalent, i.e.: hasDirectedEnds(outNode, inNode) != hasDirectedEnds(inNode, outNode).

Parameters:
outNode - the out node (from which the edge leaves).
inNode - the in node (to which the edge goes to).
Returns:

getInNode

N getInNode()
Get the node to which the end goes into.

Returns:
The node, which will not be null.

getOutNode

N getOutNode()
Get the node to which the end comes from.

Returns:
The node, which will not be null.

reversedNodes

IDirectedPair<N,E> reversedNodes()
Create a new node pair, with the nodes reversed as if this edge was pointing in the other direction.

Returns:
the new directed edge with the in and out nodes switched relative to this one. Cannot be null.