|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.android.utils.Pair<S,T>
S - The type of the first valueT - The type of the second valuepublic class Pair<S,T>
A Pair class is simply a 2-tuple for use in this package. We might want to
think about adding something like this to a more central utility place, or
replace it by a common tuple class if one exists, or even rewrite the layout
classes using this Pair by a more dedicated data structure (so we don't have
to pass around generic signatures as is currently done, though at least the
construction is helped a bit by the of(S, T) factory method.
| Method Summary | ||
|---|---|---|
boolean |
equals(java.lang.Object obj)
|
|
S |
getFirst()
Return the first item in the pair |
|
T |
getSecond()
Return the second item in the pair |
|
int |
hashCode()
|
|
static
|
of(S first,
T second)
Constructs a new pair of the given two objects, inferring generic types. |
|
java.lang.String |
toString()
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Method Detail |
|---|
public S getFirst()
public T getSecond()
public static <S,T> Pair<S,T> of(S first,
T second)
S - the type of the first itemT - the type of the second itemfirst - the first item to store in the pairsecond - the second item to store in the pair
public java.lang.String toString()
toString in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||