Package com.gengoai.tuple
Class NTuple
- java.lang.Object
-
- com.gengoai.tuple.Tuple
-
- com.gengoai.tuple.NTuple
-
- All Implemented Interfaces:
Copyable<Tuple>
,Serializable
,Comparable<Tuple>
,Iterable<Object>
public class NTuple extends Tuple
Generic N-degree tuple.
- 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 objectsNTuple
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.Iterator<Object>
iterator()
static NTuple
of(@NonNull Object... items)
Creates an NTuple of the given itemsstatic NTuple
of(@NonNull List<?> items)
Creates an NTuple of the given itemsString
toString()
-
Methods inherited from class com.gengoai.tuple.Tuple
appendLeft, appendRight, compareTo, equals, hashCode, 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
-
-
-
-
Constructor Detail
-
NTuple
public NTuple(@NonNull @NonNull Object[] other)
Instantiates a new N tuple.- Parameters:
other
- the other
-
-
Method Detail
-
of
public static NTuple of(@NonNull @NonNull Object... items)
Creates an NTuple of the given items- Parameters:
items
- the items- Returns:
- the NTuple
-
of
public static NTuple of(@NonNull @NonNull List<?> items)
Creates an NTuple of the given items- Parameters:
items
- the items- Returns:
- the NTuple
-
copy
public NTuple 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.
-
-