Class LabelValue<A,B>
java.lang.Object
org.javatuples.Tuple
org.javatuples.LabelValue<A,B>
- All Implemented Interfaces:
Serializable, Comparable<Tuple>, Iterable<Object>, IValueLabel<A>, IValueValue<B>
A tuple of two elements, with positions 0 and 1 renamed as "label" and "value", respectively.
- Since:
- 1.0
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <X> LabelValue<X, X> fromArray(X[] array) Create tuple from array.static <X> LabelValue<X, X> fromCollection(Collection<X> collection) static <X> LabelValue<X, X> fromIterable(Iterable<X> iterable) static <X> LabelValue<X, X> fromIterable(Iterable<X> iterable, int index) private static <X> LabelValue<X, X> fromIterable(Iterable<X> iterable, int index, boolean exactSize) getLabel()intgetSize()Return the size of the tuple.getValue()<X> LabelValue<X, B> setLabel(X label) <Y> LabelValue<A, Y> setValue(Y value) static <A,B> LabelValue <A, B> with(A label, B value) Methods inherited from class Tuple
compareTo, contains, containsAll, containsAll, equals, getValue, hashCode, indexOf, iterator, lastIndexOf, toArray, toList, toStringMethods inherited from interface Iterable
forEach, spliterator
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
SIZE
private static final int SIZE- See Also:
-
label
-
value
-
-
Constructor Details
-
LabelValue
-
-
Method Details
-
with
-
fromArray
Create tuple from array. Array has to have exactly two elements.
- Type Parameters:
X- the array component type- Parameters:
array- the array to be converted to a tuple- Returns:
- the tuple
-
fromCollection
-
fromIterable
-
fromIterable
-
fromIterable
-
getLabel
- Specified by:
getLabelin interfaceIValueLabel<A>
-
getValue
- Specified by:
getValuein interfaceIValueValue<A>
-
getSize
-
setLabel
-
setValue
-