uk.ed.inf.graph.basic
Interface IBasicPair<N extends IBasicNode<N,? extends IBasicEdge<N,?>>,E extends IBasicEdge<N,E>>

All Known Subinterfaces:
IDirectedPair<N,E>, IUndirectedPair<N,E>
All Known Implementing Classes:
BaseCompoundNodePair, CompoundNodePair, NodePair

public interface IBasicPair<N extends IBasicNode<N,? extends IBasicEdge<N,?>>,E extends IBasicEdge<N,E>>


Method Summary
 boolean containsNode(N node)
          Is this node contained in this end pair.
 boolean equals(java.lang.Object other)
          Test whether a pair is equal, that is do they include the same pair of nodes.
 N getOtherNode(N node)
          Get the other node to this one in the pair.
 boolean hasEnds(N endOne, N endTwo)
          Tests if this end pair is made up of these two nodes.
 int hashCode()
          The hashCode that should given identical behaviour to equals.
 

Method Detail

containsNode

boolean containsNode(N node)
Is this node contained in this end pair.

Parameters:
node - The node to test, can be null.
Returns:
true is node is contained, else false.

hasEnds

boolean hasEnds(N endOne,
                N endTwo)
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)

Parameters:
endOne - The first node end.
endTwo - The second node end.
Returns:
true if both nodes make up the end pair, false otherwise.

getOtherNode

N getOtherNode(N node)
Get the other node to this one in the pair.

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.

equals

boolean equals(java.lang.Object other)
Test whether a pair is equal, that is do they include the same pair of nodes. The ordering is important and reciprocal pairs are not regarded as equivalent. This is in addition to the standard contact for equals.

Overrides:
equals in class java.lang.Object
Parameters:
other - the other object to compare for equality.
Returns:
true if they are equals by the equals contract, false otherwise.

hashCode

int hashCode()
The hashCode that should given identical behaviour to equals. That is is equals returns true both object should have the same hash code value.

Overrides:
hashCode in class java.lang.Object
Returns: