Package com.gengoai.tuple
Class Tuple4<A,B,C,D>
- java.lang.Object
-
- com.gengoai.tuple.Tuple
-
- com.gengoai.tuple.Tuple4<A,B,C,D>
-
- Type Parameters:
A
- the type parameterB
- the type parameterC
- the type parameterD
- the type parameter
- All Implemented Interfaces:
Copyable<Tuple>
,Serializable
,Comparable<Tuple>
,Iterable<Object>
public class Tuple4<A,B,C,D> extends Tuple
The type Tuple 4.- Author:
- David B. Bracewell
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Object[]
array()
The tuple as an array of objectsTuple4<A,B,C,D>
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,D>
Tuple4<A,B,C,D>of(A a, B b, C c, D d)
Static constructorTuple3<B,C,D>
shiftLeft()
Shifts the first element of the tuple resulting in a tuple of degree - 1.Tuple3<A,B,C>
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
appendLeft, appendRight, 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
-
Tuple4
protected Tuple4(Object[] array)
-
-
Method Detail
-
of
public static <A,B,C,D> Tuple4<A,B,C,D> of(A a, B b, C c, D d)
Static constructor- Type Parameters:
A
- the type parameterB
- the type parameterC
- the type parameterD
- the type parameter- Parameters:
a
- the ab
- the bc
- the cd
- the d- Returns:
- the tuple 4
-
copy
public Tuple4<A,B,C,D> 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 Tuple3<B,C,D> shiftLeft()
Description copied from class:Tuple
Shifts the first element of the tuple resulting in a tuple of degree - 1.
-
shiftRight
public Tuple3<A,B,C> 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;
-
-