|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.google.gdata.util.common.base.Pair<A,B>
public class Pair<A,B>
Pair is an expedient way to combine two arbitrary objects into one. Its
use is not to be preferred to creating a custom type, but it can be
handy in a pinch. If your equals(java.lang.Object)
, hashCode()
,
toString()
, and/or clone()
behavior matter to you at all, you
may not want to use this (or you may at least wish to subclass).
This class may be used with the Google Web Toolkit (GWT).
Field Summary | |
---|---|
A |
first
The first element of the pair. |
B |
second
The second element of the pair. |
Constructor Summary | |
---|---|
Pair(A first,
B second)
Cumbersome way to create a new pair (see of(A, B) . |
Method Summary | ||
---|---|---|
Pair<A,B> |
clone()
|
|
boolean |
equals(java.lang.Object object)
|
|
A |
getFirst()
Optional accessor method for first . |
|
B |
getSecond()
Optional accessor method for second . |
|
int |
hashCode()
|
|
static
|
of(A first,
B second)
Creates a new pair containing the given objects in order. |
|
java.lang.String |
toString()
This implementation returns the String representation of this pair in the form (string1, string2) , where string1 and
string2 are the Object.toString() representations of the
elements inside the pair. |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public final A first
public final B second
Constructor Detail |
---|
public Pair(A first, B second)
of(A, B)
.
Method Detail |
---|
public static <A,B> Pair<A,B> of(A first, B second)
public A getFirst()
first
.
public B getSecond()
second
.
public Pair<A,B> clone()
clone
in class java.lang.Object
public boolean equals(java.lang.Object object)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
(string1, string2)
, where string1
and
string2
are the Object.toString()
representations of the
elements inside the pair.
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |