|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Objectorg.javatuples.Tuple
org.javatuples.KeyValue<A,B>
public final class KeyValue<A,B>
A tuple of two elements, with positions 0 and 1 renamed as "key" and "value", respectively.
| Constructor Summary | |
|---|---|
KeyValue(A key,
B value)
|
|
| Method Summary | ||
|---|---|---|
static
|
fromArray(X[] array)
Create tuple from array. |
|
static
|
fromCollection(Collection<X> collection)
|
|
static
|
fromIterable(Iterable<X> iterable)
|
|
static
|
fromIterable(Iterable<X> iterable,
int index)
|
|
A |
getKey()
|
|
int |
getSize()
Return the size of the tuple. |
|
B |
getValue()
|
|
|
setKey(X key)
|
|
|
setValue(Y value)
|
|
static
|
with(A key,
B value)
|
|
| Methods inherited from class org.javatuples.Tuple |
|---|
compareTo, contains, containsAll, containsAll, equals, getValue, hashCode, indexOf, iterator, lastIndexOf, toArray, toList, toString |
| Methods inherited from class Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public KeyValue(A key,
B value)
| Method Detail |
|---|
public static <A,B> KeyValue<A,B> with(A key,
B value)
public static <X> KeyValue<X,X> fromArray(X[] array)
Create tuple from array. Array has to have exactly two elements.
X - the array component typearray - the array to be converted to a tuple
public static <X> KeyValue<X,X> fromCollection(Collection<X> collection)
public static <X> KeyValue<X,X> fromIterable(Iterable<X> iterable)
public static <X> KeyValue<X,X> fromIterable(Iterable<X> iterable,
int index)
public A getKey()
getKey in interface IValueKey<A>public B getValue()
getValue in interface IValueValue<B>public int getSize()
TupleReturn the size of the tuple.
getSize in class Tuplepublic <X> KeyValue<X,B> setKey(X key)
public <Y> KeyValue<A,Y> setValue(Y value)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||