K - The type for the KeyV - The type for the stored valuepublic class Tuple<K,V> extends Object implements Comparable<Tuple<K,V>>
| Modifier and Type | Field and Description |
|---|---|
protected K |
key
The key
|
protected Comparator<K> |
keyComparator
The key comparator
|
protected V |
value
The value
|
| Constructor and Description |
|---|
Tuple()
Creates a Tuple with no content
|
Tuple(K key,
V value)
Creates a Tuple containing a key and its associated value.
|
Tuple(K key,
V value,
Comparator<K> keyComparator)
Creates a Tuple containing a key and its associated value.
|
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(Tuple<K,V> t) |
boolean |
equals(Object obj) |
K |
getKey() |
Comparator<K> |
getKeyComparator() |
V |
getValue() |
int |
hashCode() |
void |
setKey(K key) |
void |
setKeyComparator(Comparator<K> keyComparator) |
void |
setValue(V value) |
String |
toString() |
protected K key
protected V value
protected Comparator<K> keyComparator
public Tuple()
public Tuple(K key, V value)
key - The keyvalue - The associated valuepublic Tuple(K key, V value, Comparator<K> keyComparator)
key - The keyvalue - The associated valuepublic K getKey()
public void setKey(K key)
key - the key to setpublic V getValue()
public void setValue(V value)
value - the value to setpublic int hashCode()
hashCode in class ObjectObject.hashCode()public int compareTo(Tuple<K,V> t)
compareTo in interface Comparable<Tuple<K,V>>Comparable.compareTo(java.lang.Object)public Comparator<K> getKeyComparator()
public void setKeyComparator(Comparator<K> keyComparator)
keyComparator - the keyComparator to setpublic String toString()
toString in class ObjectObject.toString()Copyright © 2012–2015 Apache Mavibot Project Parent. All rights reserved.