U - 对象1V - 对象2public class Pair<U,V>
extends java.lang.Object
implements java.io.Serializable
| 限定符和类型 | 方法和说明 |
|---|---|
boolean |
equals(java.lang.Object o)
Test this
Pair for equality with another
Object. |
U |
getFirst()
Gets the first for this pair.
|
V |
getSecond()
Gets the second for this pair.
|
int |
hashCode()
Generate a hash code for this
Pair. |
java.lang.String |
toString()
String representation of this
Pair. |
public U getFirst()
public V getSecond()
public java.lang.String toString()
String representation of this
Pair.
The default name/second delimiter '=' is always used.
toString 在类中 java.lang.ObjectString representation of this Pairpublic int hashCode()
Generate a hash code for this Pair.
The hash code is calculated using both the name and
the second of the Pair.
hashCode 在类中 java.lang.ObjectPairpublic boolean equals(java.lang.Object o)
Test this Pair for equality with another
Object.
If the Object to be tested is not a
Pair or is null, then this method
returns false.
Two Pairs are considered equal if and only if
both the names and values are equal.
equals 在类中 java.lang.Objecto - the Object to test for
equality with this Pairtrue if the given Object is
equal to this Pair else false