|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object jaggregate.Pair<K,V>
K
- the type of the pair's keyV
- the type of the pair's valuepublic class Pair<K,V>
A simple 2-tuple, typically used to represent the key-value pairs of an
AbstractDictionary
.
Constructor Summary | |
---|---|
Pair(K key,
V value)
Creates a pair. |
Method Summary | ||
---|---|---|
boolean |
equals(Object that)
|
|
int |
hashCode()
|
|
K |
key()
Gives the pair's key. |
|
static
|
pair(T key,
U value)
Creates a new pair with the given key and value. |
|
String |
toString()
|
|
V |
value()
Gives the pair's value. |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Pair(K key, V value)
key
- the new pair's keyvalue
- the new pair's valueMethod Detail |
---|
public static <T,U> Pair<T,U> pair(T key, U value)
Pair<Integer, Integer> square = new Pair<Integer, Integer>( 3, 9 );
versus
Pair<Integer, Integer> square = pairOf( 3, 9 );
T
- the type of the key in the resultant pairU
- the type of the value in the resultant pairkey
- a keyvalue
- a value
key
and value
public K key()
public V value()
public boolean equals(Object that)
equals
in class Object
public int hashCode()
hashCode
in class Object
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |