|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.commons.math3.util.Pair<K,V>
K
- Key type.V
- Value type.public class Pair<K,V>
Generic pair. Immutable class.
Field Summary | |
---|---|
private K |
key
Key. |
private V |
value
Value. |
Constructor Summary | |
---|---|
Pair(K k,
V v)
Create an entry representing a mapping from the specified key to the specified value. |
|
Pair(Pair<? extends K,? extends V> entry)
Create an entry representing the same mapping as the specified entry. |
Method Summary | |
---|---|
boolean |
equals(Object o)
Compare the specified object with this entry for equality. |
K |
getKey()
Get the key. |
V |
getValue()
Get the value. |
int |
hashCode()
Compute a hash code. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private final K key
private final V value
Constructor Detail |
---|
public Pair(K k, V v)
k
- Key.v
- Value.public Pair(Pair<? extends K,? extends V> entry)
entry
- Entry to copy.Method Detail |
---|
public K getKey()
public V getValue()
public boolean equals(Object o)
equals
in class Object
o
- Object.
true
if the given object is also a map entry and
the two entries represent the same mapping.public int hashCode()
hashCode
in class Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |