public class NodePair extends java.lang.Object
| Constructor and Description |
|---|
NodePair(Node a,
Node b)
Constructs a new
NodePair. |
NodePair(Pair<Node,Node> pair)
Constructs a new
NodePair. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
contains(Node n)
Determines if this pair contains the given node.
|
boolean |
equals(java.lang.Object obj) |
Node |
getA()
Replies the first node.
|
Node |
getB()
Replies the second node
|
int |
hashCode() |
boolean |
isPredecessorOf(NodePair other)
Determines if this pair is predecessor of another one (this.b == other.a)
|
boolean |
isSuccessorOf(NodePair other)
Determines if this pair is successor of another one (other.b == this.a)
|
NodePair |
swap()
Returns the inversed pair.
|
java.lang.String |
toString() |
public NodePair(Node a, Node b)
NodePair.a - The first nodeb - The second nodepublic boolean isSuccessorOf(NodePair other)
other - other pairtrue if other.b == this.apublic boolean isPredecessorOf(NodePair other)
other - other pairtrue if this.b == other.apublic java.lang.String toString()
toString in class java.lang.Objectpublic boolean contains(Node n)
n - The node to look fortrue if n is in the pair, false otherwisepublic int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Object