|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.fhstralsund.vinets.structure.NodePair
public class NodePair
A set of two Nodes. The order of the Nodes is not important.
Field Summary | |
---|---|
protected Node |
first
|
protected Node |
second
|
Constructor Summary | |
---|---|
NodePair(Node u,
Node v)
Creates a NodePair. |
Method Summary | |
---|---|
boolean |
contains(Node node)
Checks whether the passed Node is member of this NodePair. |
boolean |
equals(java.lang.Object obj)
Two NodePairs are equal if and only if they contain the same Nodes. |
Node |
getOne()
Returns one of the two Nodes. |
Node |
getOther(Node u)
Returns the one of the two Nodes in a NodePair that is not identical with the parameter Node. |
int |
hashCode()
Two NodePairs containing the same Nodes have the same hashCode. |
java.util.Iterator |
iterator()
Returns an iterator over the two Nodes. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected Node first
protected Node second
Constructor Detail |
---|
public NodePair(Node u, Node v)
u
- v
- the two Nodes, they should not be the null reference.Method Detail |
---|
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- a NodePair to compare with
public int hashCode()
hashCode
in class java.lang.Object
public Node getOne()
public Node getOther(Node u)
u
- a Node contained in this NodePair
java.lang.IllegalArgumentException
- if u is not a member of this NodePairpublic java.util.Iterator iterator()
public boolean contains(Node node)
node
- the Node
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |