|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.groiss.ds.Pair<F,S>
public class Pair<F,S>
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 | |
|---|---|
F |
first
The first object. |
S |
second
The second object. |
| Constructor Summary | |
|---|---|
Pair()
|
|
Pair(F first,
S second)
Constructor for holding a pair of objects. |
|
| Method Summary | |
|---|---|
boolean |
equals(Object obj)
Returns true if obj is also a Pair and contains two
objects equal to the two objects of this Pair. |
F |
getKey()
Return the first object |
S |
getValue()
Return the second object |
int |
hashCode()
Builds a new hash code out of the two objects' hash codes. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public F first
public S second
| Constructor Detail |
|---|
public Pair()
public Pair(F first,
S second)
| Method Detail |
|---|
public F getKey()
getKey in interface KeyValuePair<F,S>public S getValue()
getValue in interface KeyValuePair<F,S>public String toString()
toString in class Objectpublic boolean equals(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 Objectpublic int hashCode()
hashCode in class Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||