public class Pair<F,S> extends Object
By packing two parameters into one, Pair container makes parameter transfer easier.
| 限定符和类型 | 字段 | 说明 |
|---|---|---|
F |
f |
Indicates first object of the pair.
|
S |
s |
Indicates second object of the pair.
|
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
static <F,S> Pair<F,S> |
create(F f,
S s) |
Creates a
Pair object using objects f and s. |
boolean |
equals(Object obj) |
Checks whether the current
Pair object is the same as a specified Object. |
int |
hashCode() |
Obtains the hash value of the current
Pair object. |
String |
toString() |
Obtains a character string that contains all the values of a
Pair object. |
public final F f
public final S s
public static <F,S> Pair<F,S> create(F f, S s)
Pair object using objects f and s.f - Indicates the first object used to create the Pair object.s - Indicates the second object used to create the Pair object.Pair object.public boolean equals(Object obj)
Pair object is the same as a specified Object.equals 在类中 Objectobj - Indicates the Object to be compared with the current Pair object.true if the current Pair object is the same as the specified Object;
returns false otherwise.Object.hashCode(),
HashMappublic int hashCode()
Pair object.
The System.identityHashCode method is used to calculate the hash value
of the current Pair object.
hashCode 在类中 ObjectPair object.Object.equals(java.lang.Object),
System.identityHashCode(java.lang.Object)