Package com.gengoai.tuple
Class Tuple1<V1>
- java.lang.Object
-
- com.gengoai.tuple.Tuple
-
- com.gengoai.tuple.Tuple1<V1>
-
- Type Parameters:
V1
- the type parameter
- All Implemented Interfaces:
Copyable<Tuple>
,Serializable
,Comparable<Tuple>
,Iterable<Object>
public class Tuple1<V1> extends Tuple
A tuple of degree one.- Author:
- David B. Bracewell
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> Tuple2<T,V1>
appendLeft(T object)
Appends an item the beginning of the tuple resulting in a new tuple of degree + 1<T> Tuple2<V1,T>
appendRight(T object)
Appends an item the end of the tuple resulting in a new tuple of degree + 1Object[]
array()
The tuple as an array of objectsTuple1<V1>
copy()
Makes a copy of this object.int
degree()
The number of items in the tuple<T> T
get(int i)
Gets the ith item of the tuple.V1
getV1()
static <V1> Tuple1<V1>
of(V1 v1)
Of tuple 1.String
toString()
-
Methods inherited from class com.gengoai.tuple.Tuple
compareTo, equals, hashCode, iterator, map, mapValues, shiftLeft, shiftRight, slice, stream
-
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 Detail
-
v1
public final V1 v1
The V 1.
-
-
Method Detail
-
of
public static <V1> Tuple1<V1> of(V1 v1)
Of tuple 1.- Type Parameters:
V1
- the type parameter- Parameters:
v1
- the v 1- Returns:
- the tuple 1
-
appendLeft
public <T> Tuple2<T,V1> appendLeft(T object)
Description copied from class:Tuple
Appends an item the beginning of the tuple resulting in a new tuple of degree + 1- Overrides:
appendLeft
in classTuple
- Type Parameters:
T
- the type parameter- Parameters:
object
- the object being appended- Returns:
- A new tuple of degree + 1 containing the object at the beginning
-
appendRight
public <T> Tuple2<V1,T> appendRight(T object)
Description copied from class:Tuple
Appends an item the end of the tuple resulting in a new tuple of degree + 1- Overrides:
appendRight
in classTuple
- Type Parameters:
T
- the type parameter- Parameters:
object
- the object being appended- Returns:
- A new tuple of degree + 1 containing the object at the end
-
copy
public Tuple1<V1> copy()
Description copied from interface:Copyable
Makes a copy of this object.
- Returns:
- A copy of this object.
-
degree
public int degree()
Description copied from class:Tuple
The number of items in the tuple
-
get
public <T> T get(int i)
Description copied from class:Tuple
Gets the ith item of the tuple.
-
getV1
public V1 getV1()
-
-