Package com.gengoai.tuple
Class Tuple3<A,B,C>
- java.lang.Object
-
- com.gengoai.tuple.Tuple
-
- com.gengoai.tuple.Tuple3<A,B,C>
-
- Type Parameters:
A
- the type parameterB
- the type parameterC
- the type parameter
- All Implemented Interfaces:
Copyable<Tuple>
,Serializable
,Comparable<Tuple>
,Iterable<Object>
public class Tuple3<A,B,C> extends Tuple
The type Tuple 3.- Author:
- David B. Bracewell
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> Tuple4<T,A,B,C>
appendLeft(T object)
Appends an item the beginning of the tuple resulting in a new tuple of degree + 1<T> Tuple4<A,B,C,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 objectsTuple
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.static <A,B,C>
Tuple3<A,B,C>of(A a, B b, C c)
Static ConstructorTuple2<B,C>
shiftLeft()
Shifts the first element of the tuple resulting in a tuple of degree - 1.Tuple2<A,B>
shiftRight()
Shifts the last element of the tuple resulting in a tuple of degree - 1.String
toString()
-
Methods inherited from class com.gengoai.tuple.Tuple
compareTo, equals, hashCode, iterator, map, mapValues, 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
-
-
-
-
Constructor Detail
-
Tuple3
protected Tuple3(Object[] array)
-
-
Method Detail
-
of
public static <A,B,C> Tuple3<A,B,C> of(A a, B b, C c)
Static Constructor- Type Parameters:
A
- the type parameterB
- the type parameterC
- the type parameter- Parameters:
a
- the ab
- the bc
- the c- Returns:
- the tuple 3
-
appendLeft
public <T> Tuple4<T,A,B,C> 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> Tuple4<A,B,C,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 Tuple 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.
-
shiftLeft
public Tuple2<B,C> shiftLeft()
Description copied from class:Tuple
Shifts the first element of the tuple resulting in a tuple of degree - 1.
-
shiftRight
public Tuple2<A,B> shiftRight()
Description copied from class:Tuple
Shifts the last element of the tuple resulting in a tuple of degree - 1.- Overrides:
shiftRight
in classTuple
- Returns:
- A new tuple without the shifted element;
-
-