key and value. A pair is considered to be
equal to another pair if both the key and the value are equal.
| Modifier and Type | Field and Description |
|---|---|
| private final K | |
| private static final long | |
| private final V |
| Access | Constructor and Description |
|---|---|
| public | Pair(K
the key. May be k, V null.the value. May be v)null.Creates a new instance with the given key and value. |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | equals(Object o)
Overrides java. Indicates whether some other object is "equal to" this one. |
| public K | |
| public V | |
| public int | |
| public static <K, V> Pair | Returns: a newly created pair. Nevernull.the key. May be k, V null.the value. May be v)null.Creates a new instance with the given key and value. |
| public String |
| k | back to summary |
|---|---|
| private final K k | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID | |
| v | back to summary |
|---|---|
| private final V v | |
| Pair | back to summary |
|---|---|
| public Pair(K k, V v) Creates a new instance with the given key and value.
| |
| equals | back to summary |
|---|---|
| public boolean equals(Object o) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.
| |
| getKey | back to summary |
|---|---|
| public K getKey() Returns the key.
| |
| getValue | back to summary |
|---|---|
| public V getValue() Returns the value.
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| of | back to summary |
|---|---|
| public static <K, V> Pair Creates a new instance with the given key and value. May be used instead of the constructor for convenience reasons. | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non-
| |