public class LongIterators
extends java.lang.Object
| Constructor and Description |
|---|
LongIterators() |
| Modifier and Type | Method and Description |
|---|---|
static <E> ObjectIterator<E> |
arrayFlatMap(java.util.Iterator<? extends java.lang.Long> iterator,
Long2ObjectFunction<E[]> mapper)
A Helper function that flatMaps a Java-Iterator into a new Type.
|
static <E> ObjectIterator<E> |
arrayFlatMap(LongIterator iterator,
Long2ObjectFunction<E[]> mapper)
A Helper function that flatMaps a Iterator into a new Type.
|
static LongIterator |
concat(LongIterator... array)
Helper Iterator that concats other iterators together
|
static LongIterator |
concat(LongIterator[] array,
int offset,
int length)
Helper Iterator that concats other iterators together
|
static LongIterator |
distinct(java.util.Iterator<? extends java.lang.Long> iterator)
A Helper function that filters out all duplicated elements from a Java Iterator.
|
static LongIterator |
distinct(LongIterator iterator)
A Helper function that filters out all duplicated elements.
|
static speiger.src.collections.longs.utils.LongIterators.EmptyIterator |
empty()
Returns a Immutable EmptyIterator instance that is automatically casted.
|
static LongIterator |
filter(java.util.Iterator<? extends java.lang.Long> iterator,
Long2BooleanFunction filter)
A Helper function that filters out all desired elements from a Java-Iterator
|
static LongIterator |
filter(LongIterator iterator,
Long2BooleanFunction filter)
A Helper function that filters out all desired elements
|
static <E,V extends java.lang.Iterable<E>> |
flatMap(java.util.Iterator<? extends java.lang.Long> iterator,
Long2ObjectFunction<V> mapper)
A Helper function that flatMaps a Java-Iterator into a new Type.
|
static <E,V extends java.lang.Iterable<E>> |
flatMap(LongIterator iterator,
Long2ObjectFunction<V> mapper)
A Helper function that flatMaps a Iterator into a new Type.
|
static LongBidirectionalIterator |
invert(LongBidirectionalIterator it)
Inverter function for Bidirectional Iterators
|
static LongListIterator |
invert(LongListIterator it)
Inverter function for List Iterators
|
static LongIterator |
limit(java.util.Iterator<? extends java.lang.Long> iterator,
long limit)
A Helper function that hard limits the Iterator to a specific size from a Java Iterator
|
static LongIterator |
limit(LongIterator iterator,
long limit)
A Helper function that hard limits the Iterator to a specific size
|
static <E> ObjectIterator<E> |
map(java.util.Iterator<? extends java.lang.Long> iterator,
Long2ObjectFunction<E> mapper)
A Helper function that maps a Java-Iterator into a new Type.
|
static <E> ObjectIterator<E> |
map(LongIterator iterator,
Long2ObjectFunction<E> mapper)
A Helper function that maps a Iterator into a new Type.
|
static LongIterator |
peek(java.util.Iterator<? extends java.lang.Long> iterator,
LongConsumer action)
A Helper function that allows to preview the result of a Iterator from a Java Iterator
|
static LongIterator |
peek(LongIterator iterator,
LongConsumer action)
A Helper function that allows to preview the result of a Iterator.
|
static LongList |
pour(LongIterator iter)
A Helper function to pours all elements of a Iterator into a List
|
static LongList |
pour(LongIterator iter,
int max)
A Helper function to pours all elements of a Iterator into a List
|
static int |
pour(LongIterator iter,
LongCollection c)
A Helper function to pours all elements of a Iterator into a Collection
|
static int |
pour(LongIterator iter,
LongCollection c,
int max)
A Helper function to pours all elements of a Iterator into a Collection
|
static LongIterator |
sorted(java.util.Iterator<? extends java.lang.Long> iterator,
LongComparator sorter)
A Helper function that sorts the Iterator beforehand from a Java Iterator.
|
static LongIterator |
sorted(LongIterator iterator,
LongComparator sorter)
A Helper function that sorts the Iterator beforehand.
|
static LongBidirectionalIterator |
unmodifiable(LongBidirectionalIterator iterator)
Returns a Immutable Iterator instance based on the instance given.
|
static LongIterator |
unmodifiable(LongIterator iterator)
Returns a Immutable Iterator instance based on the instance given.
|
static LongListIterator |
unmodifiable(LongListIterator iterator)
Returns a Immutable ListIterator instance based on the instance given.
|
static int |
unwrap(long[] a,
java.util.Iterator<? extends java.lang.Long> i)
Iterates over a iterator and inserts the values into the array and returns the amount that was inserted
|
static int |
unwrap(long[] a,
java.util.Iterator<? extends java.lang.Long> i,
int offset)
Iterates over a iterator and inserts the values into the array and returns the amount that was inserted
|
static int |
unwrap(long[] a,
java.util.Iterator<? extends java.lang.Long> i,
int offset,
int max)
Iterates over a iterator and inserts the values into the array and returns the amount that was inserted
|
static int |
unwrap(long[] a,
LongIterator i)
A Primitive iterator variant of the LongIterators unwrap function
Iterates over a iterator and inserts the values into the array and returns the amount that was inserted
|
static int |
unwrap(java.lang.Long[] a,
LongIterator i)
A Function to convert a Primitive Iterator to a Object array.
|
static int |
unwrap(long[] a,
LongIterator i,
int offset)
A Primitive iterator variant of the LongIterators unwrap function
Iterates over a iterator and inserts the values into the array and returns the amount that was inserted
|
static int |
unwrap(java.lang.Long[] a,
LongIterator i,
int offset)
A Function to convert a Primitive Iterator to a Object array.
|
static int |
unwrap(long[] a,
LongIterator i,
int offset,
int max)
A Primitive iterator variant of the LongIterators unwrap function
Iterates over a iterator and inserts the values into the array and returns the amount that was inserted
|
static int |
unwrap(java.lang.Long[] a,
LongIterator i,
int offset,
int max)
A Function to convert a Primitive Iterator to a Object array.
|
static LongIterator |
wrap(java.util.Iterator<? extends java.lang.Long> iterator)
Helper function to convert a Object Iterator into a Primitive Iterator
|
static speiger.src.collections.longs.utils.LongIterators.ArrayIterator |
wrap(long... a)
Returns a Array Wrapping iterator
|
static speiger.src.collections.longs.utils.LongIterators.ArrayIterator |
wrap(long[] a,
int start,
int end)
Returns a Array Wrapping iterator
|
public static speiger.src.collections.longs.utils.LongIterators.EmptyIterator empty()
public static LongBidirectionalIterator invert(LongBidirectionalIterator it)
it - the iterator that should be invertedpublic static LongListIterator invert(LongListIterator it)
it - the iterator that should be invertedpublic static LongIterator unmodifiable(LongIterator iterator)
iterator - that should be made immutable/unmodifiablepublic static LongBidirectionalIterator unmodifiable(LongBidirectionalIterator iterator)
iterator - that should be made immutable/unmodifiablepublic static LongListIterator unmodifiable(LongListIterator iterator)
iterator - that should be made immutable/unmodifiablepublic static <E> ObjectIterator<E> map(java.util.Iterator<? extends java.lang.Long> iterator, Long2ObjectFunction<E> mapper)
E - The return type.iterator - that should be mappedmapper - the function that decides what the result turns into.public static <E> ObjectIterator<E> map(LongIterator iterator, Long2ObjectFunction<E> mapper)
E - The return type.iterator - that should be mappedmapper - the function that decides what the result turns into.public static <E,V extends java.lang.Iterable<E>> ObjectIterator<E> flatMap(java.util.Iterator<? extends java.lang.Long> iterator, Long2ObjectFunction<V> mapper)
V - The return type supplier.E - The return type.iterator - that should be flatMappedmapper - the function that decides what the result turns into.public static <E,V extends java.lang.Iterable<E>> ObjectIterator<E> flatMap(LongIterator iterator, Long2ObjectFunction<V> mapper)
V - The return type supplier.E - The return type.iterator - that should be flatMappedmapper - the function that decides what the result turns into.public static <E> ObjectIterator<E> arrayFlatMap(java.util.Iterator<? extends java.lang.Long> iterator, Long2ObjectFunction<E[]> mapper)
E - The return type.iterator - that should be flatMappedmapper - the function that decides what the result turns into.public static <E> ObjectIterator<E> arrayFlatMap(LongIterator iterator, Long2ObjectFunction<E[]> mapper)
E - The return type.iterator - that should be flatMappedmapper - the function that decides what the result turns into.public static LongIterator filter(java.util.Iterator<? extends java.lang.Long> iterator, Long2BooleanFunction filter)
iterator - that should be filtered.filter - the filter that decides that should be let throughpublic static LongIterator filter(LongIterator iterator, Long2BooleanFunction filter)
iterator - that should be filtered.filter - the filter that decides that should be let throughpublic static LongIterator distinct(LongIterator iterator)
iterator - that should be distinctpublic static LongIterator distinct(java.util.Iterator<? extends java.lang.Long> iterator)
iterator - that should be distinctpublic static LongIterator limit(LongIterator iterator, long limit)
iterator - that should be limitedlimit - the amount of elements it should be limited topublic static LongIterator limit(java.util.Iterator<? extends java.lang.Long> iterator, long limit)
iterator - that should be limitedlimit - the amount of elements it should be limited topublic static LongIterator sorted(LongIterator iterator, LongComparator sorter)
iterator - that should be sorted.sorter - the sorter of the iterator. Can be null.public static LongIterator sorted(java.util.Iterator<? extends java.lang.Long> iterator, LongComparator sorter)
iterator - that should be sorted.sorter - the sorter of the iterator. Can be null.public static LongIterator peek(LongIterator iterator, LongConsumer action)
iterator - that should be peeked ataction - callback that receives the value before the iterator returns itpublic static LongIterator peek(java.util.Iterator<? extends java.lang.Long> iterator, LongConsumer action)
iterator - that should be peeked ataction - callback that receives the value before the iterator returns itpublic static LongIterator wrap(java.util.Iterator<? extends java.lang.Long> iterator)
iterator - that should be converted to a unboxing iteratorpublic static speiger.src.collections.longs.utils.LongIterators.ArrayIterator wrap(long... a)
a - the array that should be wrappedpublic static speiger.src.collections.longs.utils.LongIterators.ArrayIterator wrap(long[] a,
int start,
int end)
a - the array that should be wrapped.start - the index to be started from.end - the index that should be ended.public static int unwrap(long[] a,
java.util.Iterator<? extends java.lang.Long> i)
a - where the elements should be insertedi - the source iteratorpublic static int unwrap(long[] a,
java.util.Iterator<? extends java.lang.Long> i,
int offset)
a - where the elements should be insertedi - the source iteratoroffset - the array offset where the start should bepublic static int unwrap(long[] a,
java.util.Iterator<? extends java.lang.Long> i,
int offset,
int max)
a - where the elements should be insertedi - the source iteratoroffset - the array offset where the start should bemax - the maximum values that should be extracted from the sourcejava.lang.IllegalStateException - if max is smaller the 0 or if the maximum index is larger then the arraypublic static int unwrap(long[] a,
LongIterator i)
a - where the elements should be insertedi - the source iteratorpublic static int unwrap(long[] a,
LongIterator i,
int offset)
a - where the elements should be insertedi - the source iteratoroffset - the array offset where the start should bepublic static int unwrap(long[] a,
LongIterator i,
int offset,
int max)
a - where the elements should be insertedi - the source iteratoroffset - the array offset where the start should bemax - the maximum values that should be extracted from the sourcejava.lang.IllegalStateException - if max is smaller the 0 or if the maximum index is larger then the arraypublic static int unwrap(java.lang.Long[] a,
LongIterator i)
a - where the elements should be insertedi - the source iteratorpublic static int unwrap(java.lang.Long[] a,
LongIterator i,
int offset)
a - where the elements should be insertedi - the source iteratoroffset - the array offset where the start should bepublic static int unwrap(java.lang.Long[] a,
LongIterator i,
int offset,
int max)
a - where the elements should be insertedi - the source iteratoroffset - the array offset where the start should bemax - the maximum values that should be extracted from the sourcejava.lang.IllegalStateException - if max is smaller the 0 or if the maximum index is larger then the arraypublic static LongList pour(LongIterator iter)
iter - the elements that should be poured into list.public static LongList pour(LongIterator iter, int max)
iter - the elements that should be poured into list.max - the maximum amount of elements that should be collectedpublic static int pour(LongIterator iter, LongCollection c)
iter - the elements that should be poured into list.c - the collection where the elements should be poured intopublic static int pour(LongIterator iter, LongCollection c, int max)
iter - the elements that should be poured into list.c - the collection where the elements should be poured intomax - the maximum amount of elements that should be collectedpublic static LongIterator concat(LongIterator... array)
array - the Iterators that should be concatenatedpublic static LongIterator concat(LongIterator[] array, int offset, int length)
array - the Iterators that should be concatenatedoffset - where to start within the arraylength - the length of the array