Package org.apache.jena.atlas.lib.tuple
Interface Tuple<X>
-
- All Superinterfaces:
java.lang.Iterable<X>
- All Known Implementing Classes:
Tuple0,Tuple1,Tuple2,Tuple3,Tuple4,Tuple5,Tuple6,Tuple7,Tuple8,TupleN
public interface Tuple<X> extends java.lang.Iterable<X>A Tuple is a sequence of items of the same class of item. Tuples are immutable. .equals is "by value".
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default X[]asArray(java.lang.Class<X> cls)Copy the elements of this Tuple into a newly created arraydefault java.util.List<X>asList()Convert to a Listbooleancontains(X item)forEachdefault voidcopyInto(X[] array)Copy the elements of this Tuple into the arraydefault voidcopyInto(X[] array, int start)Copy the elements of this Tuple start at 'start' into the arraydefault voidcopyInto(X[] array, int start, int length)Copy the elements of this Tuple into the arraydefault voidforEach(java.util.function.Consumer<? super X> action)forEachXget(int i)Get the i'th element, for i in the range 0 to len()-1default booleanisEmpty()Return true if this is a zero-length tupledefault java.util.Iterator<X>iterator()Iterableintlen()length : elements are 0 to len()-1<Y> Tuple<Y>map(java.util.function.Function<X,Y> function)Map to a new tuple.default java.util.stream.Stream<X>stream()stream
-
-
-
Method Detail
-
get
X get(int i)
Get the i'th element, for i in the range 0 to len()-1- Throws:
java.lang.IndexOutOfBoundsException- for i out of range
-
len
int len()
length : elements are 0 to len()-1
-
isEmpty
default boolean isEmpty()
Return true if this is a zero-length tuple
-
asList
default java.util.List<X> asList()
Convert to a List
-
contains
boolean contains(X item)
forEach
-
stream
default java.util.stream.Stream<X> stream()
stream
-
forEach
default void forEach(java.util.function.Consumer<? super X> action)
forEach- Specified by:
forEachin interfacejava.lang.Iterable<X>
-
iterator
default java.util.Iterator<X> iterator()
Iterable- Specified by:
iteratorin interfacejava.lang.Iterable<X>
-
copyInto
default void copyInto(X[] array)
Copy the elements of this Tuple into the array
-
copyInto
default void copyInto(X[] array, int start)
Copy the elements of this Tuple start at 'start' into the array
-
copyInto
default void copyInto(X[] array, int start, int length)
Copy the elements of this Tuple into the array
-
-