uk.ed.inf.graph.compound.base
Class BaseCompoundNodePair

java.lang.Object
  extended by uk.ed.inf.graph.compound.base.BaseCompoundNodePair
All Implemented Interfaces:
IBasicPair<BaseCompoundNode,BaseCompoundEdge>, IDirectedPair<BaseCompoundNode,BaseCompoundEdge>
Direct Known Subclasses:
CompoundNodePair

public abstract class BaseCompoundNodePair
extends java.lang.Object
implements IDirectedPair<BaseCompoundNode,BaseCompoundEdge>


Constructor Summary
BaseCompoundNodePair()
           
 
Method Summary
 boolean containsNode(BaseCompoundNode node)
          Is this node contained in this end pair.
abstract  BaseCompoundNode getInNode()
          Get the node to which the end goes into.
 BaseCompoundNode getOneNode()
           
 BaseCompoundNode getOtherNode(BaseCompoundNode node)
          Get the other node to this one in the pair.
abstract  BaseCompoundNode getOutNode()
          Get the node to which the end comes from.
 BaseCompoundNode getTwoNode()
           
 boolean hasDirectedEnds(BaseCompoundNode outNode, BaseCompoundNode inNode)
          Tests if the ends exist in this directed pair.
 boolean hasEnds(BaseCompoundNode endOne, BaseCompoundNode endTwo)
          Tests if this end pair is made up of these two nodes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface uk.ed.inf.graph.directed.IDirectedPair
reversedNodes
 
Methods inherited from interface uk.ed.inf.graph.basic.IBasicPair
equals, hashCode
 

Constructor Detail

BaseCompoundNodePair

public BaseCompoundNodePair()
Method Detail

containsNode

public boolean containsNode(BaseCompoundNode node)
Description copied from interface: IBasicPair
Is this node contained in this end pair.

Specified by:
containsNode in interface IBasicPair<BaseCompoundNode,BaseCompoundEdge>
Parameters:
node - The node to test, can be null.
Returns:
true is node is contained, else false.

getOneNode

public BaseCompoundNode getOneNode()

getOtherNode

public BaseCompoundNode getOtherNode(BaseCompoundNode node)
Description copied from interface: IBasicPair
Get the other node to this one in the pair.

Specified by:
getOtherNode in interface IBasicPair<BaseCompoundNode,BaseCompoundEdge>
Parameters:
node - The node to test, cannot be null.
Returns:
The other node of the pair. If the nodes in the pair are identical then will return the same instance as node.

getTwoNode

public BaseCompoundNode getTwoNode()

getInNode

public abstract BaseCompoundNode getInNode()
Description copied from interface: IDirectedPair
Get the node to which the end goes into.

Specified by:
getInNode in interface IDirectedPair<BaseCompoundNode,BaseCompoundEdge>
Returns:
The node, which will not be null.

getOutNode

public abstract BaseCompoundNode getOutNode()
Description copied from interface: IDirectedPair
Get the node to which the end comes from.

Specified by:
getOutNode in interface IDirectedPair<BaseCompoundNode,BaseCompoundEdge>
Returns:
The node, which will not be null.

hasEnds

public boolean hasEnds(BaseCompoundNode endOne,
                       BaseCompoundNode endTwo)
Description copied from interface: IBasicPair
Tests if this end pair is made up of these two nodes. This is ignores the direction of the edge these edges make up. In all cases, even for directed edges the following holds:

hasEnds(endOne, endTwo) == hasEnds(endTwo, endOne)

Specified by:
hasEnds in interface IBasicPair<BaseCompoundNode,BaseCompoundEdge>
Parameters:
endOne - The first node end.
endTwo - The second node end.
Returns:
true if both nodes make up the end pair, false otherwise.

hasDirectedEnds

public boolean hasDirectedEnds(BaseCompoundNode outNode,
                               BaseCompoundNode inNode)
Description copied from interface: IDirectedPair
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).

Specified by:
hasDirectedEnds in interface IDirectedPair<BaseCompoundNode,BaseCompoundEdge>
Parameters:
outNode - the out node (from which the edge leaves).
inNode - the in node (to which the edge goes to).
Returns: