|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.groiss.ds.Pair
public class Pair
A Pair is an object that contains two other objects. It is most commonly used for conveniently storing and passing pairs of objects.
| Field Summary | |
|---|---|
java.lang.Object |
first
The first object. |
java.lang.Object |
second
The second object. |
| Constructor Summary | |
|---|---|
Pair()
|
|
Pair(java.lang.Object first,
java.lang.Object second)
Constructor for holding a pair of objects. |
|
| Method Summary | |
|---|---|
boolean |
equals(java.lang.Object obj)
Returns true if obj is also a Pair and contains two
objects equal to the two objects of this Pair. |
java.lang.Object |
getKey()
Return the first object |
java.lang.Object |
getValue()
Return the second object |
int |
hashCode()
Builds a new hash code out of the two objects' hash codes. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public java.lang.Object first
public java.lang.Object second
| Constructor Detail |
|---|
public Pair()
public Pair(java.lang.Object first,
java.lang.Object second)
| Method Detail |
|---|
public java.lang.Object getKey()
getKey in interface KeyValuePairpublic java.lang.Object getValue()
getValue in interface KeyValuePairpublic java.lang.String toString()
toString in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
true if obj is also a Pair and contains two
objects equal to the two objects of this Pair. null references are
considered as equal, too.
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||