public class KeyValuePair<K,V>
extends java.lang.Object
Constructor and Description |
---|
KeyValuePair()
Constructs a key-value pair such that the key and value are both null.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(KeyValuePair<K,V> pair)
Implements a test for equality, based on key values.
|
K |
getKey()
Reports the key of this KeyValuePair.
|
V |
getValue()
Reports the value of this KeyValuePair.
|
void |
setKey(K k)
Sets the key to be the input received.
|
void |
setValue(V v)
Sets the value to be the input received.
|
public KeyValuePair()
public K getKey()
public void setKey(K k)
k
- the new key to be stored in this KeyValuePairpublic V getValue()
public void setValue(V v)
v
- the new value to be stored in this KeyValuePairpublic boolean equals(KeyValuePair<K,V> pair)
pair
- the key-value pair whose key is to be compared to this one’s