Class Tuple
java.lang.Object
org.javatuples.Tuple
- All Implemented Interfaces:
Serializable, Comparable<Tuple>, Iterable<Object>
- Direct Known Subclasses:
Decade, Ennead, KeyValue, LabelValue, Octet, Pair, Quartet, Quintet, Septet, Sextet, Triplet, Unit
public abstract class Tuple
extends Object
implements Iterable<Object>, Serializable, Comparable<Tuple>
Abstract base class for all tuple classes.
- Since:
- 1.0
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintfinal booleanfinal booleancontainsAll(Object... values) final booleancontainsAll(Collection<?> collection) final booleanabstract intgetSize()Return the size of the tuple.final ObjectgetValue(int pos) Get the value at a specific position in the tuple.final inthashCode()final intiterator()final intlastIndexOf(Object value) final Object[]toArray()toList()final StringtoString()Methods inherited from interface Iterable
forEach, spliterator
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
valueArray
-
valueList
-
-
Constructor Details
-
Tuple
Deprecated.Will be removed in 1.4. The "size" parameter is of no use at this level, so use the simpler Tuple(values) constructor instead. -
Tuple
-
-
Method Details
-
getSize
public abstract int getSize()Return the size of the tuple.
- Returns:
- the size of the tuple.
-
getValue
Get the value at a specific position in the tuple. This method has to return object, so using it you will lose the type-safety you get with the getValueX() methods.
- Parameters:
pos- the position of the value to be retrieved.- Returns:
- the value
-
iterator
-
toString
-
contains
-
containsAll
-
containsAll
-
indexOf
-
lastIndexOf
-
toList
-
toArray
-
hashCode
-
equals
-
compareTo
- Specified by:
compareToin interfaceComparable<Tuple>
-