Package org.javatuples
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 TypeMethodDescriptionint
final boolean
final boolean
containsAll
(Object... values) final boolean
containsAll
(Collection<?> collection) final boolean
abstract int
getSize()
Return the size of the tuple.final Object
getValue
(int pos) Get the value at a specific position in the tuple.final int
hashCode()
final int
iterator()
final int
lastIndexOf
(Object value) final Object[]
toArray()
toList()
final String
toString()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.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
public final int hashCode() -
equals
-
compareTo
- Specified by:
compareTo
in interfaceComparable<Tuple>
-