|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.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(java.lang.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. |
java.lang.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 java.lang.String toString()
toString
in class java.lang.Object
public 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.Object
public int hashCode()
hashCode
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |