public class IntIterators
extends java.lang.Object
| Constructor and Description |
|---|
IntIterators() |
| Modifier and Type | Method and Description |
|---|---|
static <E> ObjectIterator<E> |
arrayFlatMap(IntIterator iterator,
IntFunction<E[]> mapper)
A Helper function that flatMaps a Iterator into a new Type.
|
static <E> ObjectIterator<E> |
arrayFlatMap(java.util.Iterator<? extends java.lang.Integer> iterator,
IntFunction<E[]> mapper)
A Helper function that flatMaps a Java-Iterator into a new Type.
|
static IntIterator |
concat(IntIterator... array)
Helper Iterator that concats other iterators together
|
static IntIterator |
concat(IntIterator[] array,
int offset,
int length)
Helper Iterator that concats other iterators together
|
static IntIterator |
distinct(IntIterator iterator)
A Helper function that filters out all duplicated elements.
|
static IntIterator |
distinct(java.util.Iterator<? extends java.lang.Integer> iterator)
A Helper function that filters out all duplicated elements from a Java Iterator.
|
static speiger.src.collections.ints.utils.IntIterators.EmptyIterator |
empty()
Returns a Immutable EmptyIterator instance that is automatically casted.
|
static IntIterator |
filter(IntIterator iterator,
java.util.function.IntPredicate filter)
A Helper function that filters out all desired elements
|
static IntIterator |
filter(java.util.Iterator<? extends java.lang.Integer> iterator,
java.util.function.IntPredicate filter)
A Helper function that filters out all desired elements from a Java-Iterator
|
static <E,V extends java.lang.Iterable<E>> |
flatMap(IntIterator iterator,
IntFunction<V> mapper)
A Helper function that flatMaps a Iterator into a new Type.
|
static <E,V extends java.lang.Iterable<E>> |
flatMap(java.util.Iterator<? extends java.lang.Integer> iterator,
IntFunction<V> mapper)
A Helper function that flatMaps a Java-Iterator into a new Type.
|
static IntBidirectionalIterator |
invert(IntBidirectionalIterator it)
Inverter function for Bidirectional Iterators
|
static IntListIterator |
invert(IntListIterator it)
Inverter function for List Iterators
|
static IntIterator |
limit(IntIterator iterator,
long limit)
A Helper function that hard limits the Iterator to a specific size
|
static IntIterator |
limit(java.util.Iterator<? extends java.lang.Integer> iterator,
long limit)
A Helper function that hard limits the Iterator to a specific size from a Java Iterator
|
static <E> ObjectIterator<E> |
map(IntIterator iterator,
IntFunction<E> mapper)
A Helper function that maps a Iterator into a new Type.
|
static <E> ObjectIterator<E> |
map(java.util.Iterator<? extends java.lang.Integer> iterator,
IntFunction<E> mapper)
A Helper function that maps a Java-Iterator into a new Type.
|
static IntIterator |
peek(IntIterator iterator,
IntConsumer action)
A Helper function that allows to preview the result of a Iterator.
|
static IntIterator |
peek(java.util.Iterator<? extends java.lang.Integer> iterator,
IntConsumer action)
A Helper function that allows to preview the result of a Iterator from a Java Iterator
|
static IntList |
pour(IntIterator iter)
A Helper function to pours all elements of a Iterator into a List
|
static IntList |
pour(IntIterator iter,
int max)
A Helper function to pours all elements of a Iterator into a List
|
static int |
pour(IntIterator iter,
IntCollection c)
A Helper function to pours all elements of a Iterator into a Collection
|
static int |
pour(IntIterator iter,
IntCollection c,
int max)
A Helper function to pours all elements of a Iterator into a Collection
|
static IntIterator |
repeat(IntIterator iterator,
int repeats)
A Helper function that repeats the Iterator a specific amount of times
|
static IntIterator |
repeat(java.util.Iterator<? extends java.lang.Integer> iterator,
int repeats)
A Helper function that repeats the Iterator a specific amount of times from a Java Iterator
|
static IntIterator |
sorted(IntIterator iterator,
IntComparator sorter)
A Helper function that sorts the Iterator beforehand.
|
static IntIterator |
sorted(java.util.Iterator<? extends java.lang.Integer> iterator,
IntComparator sorter)
A Helper function that sorts the Iterator beforehand from a Java Iterator.
|
static IntBidirectionalIterator |
unmodifiable(IntBidirectionalIterator iterator)
Returns a Immutable Iterator instance based on the instance given.
|
static IntIterator |
unmodifiable(IntIterator iterator)
Returns a Immutable Iterator instance based on the instance given.
|
static IntListIterator |
unmodifiable(IntListIterator iterator)
Returns a Immutable ListIterator instance based on the instance given.
|
static int |
unwrap(int[] a,
IntIterator i)
A Primitive iterator variant of the IntIterators unwrap function
Iterates over a iterator and inserts the values into the array and returns the amount that was inserted
|
static int |
unwrap(int[] a,
IntIterator i,
int offset)
A Primitive iterator variant of the IntIterators unwrap function
Iterates over a iterator and inserts the values into the array and returns the amount that was inserted
|
static int |
unwrap(int[] a,
IntIterator i,
int offset,
int max)
A Primitive iterator variant of the IntIterators unwrap function
Iterates over a iterator and inserts the values into the array and returns the amount that was inserted
|
static int |
unwrap(int[] a,
java.util.Iterator<? extends java.lang.Integer> i)
Iterates over a iterator and inserts the values into the array and returns the amount that was inserted
|
static int |
unwrap(int[] a,
java.util.Iterator<? extends java.lang.Integer> i,
int offset)
Iterates over a iterator and inserts the values into the array and returns the amount that was inserted
|
static int |
unwrap(int[] a,
java.util.Iterator<? extends java.lang.Integer> 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(java.lang.Integer[] a,
IntIterator i)
A Function to convert a Primitive Iterator to a Object array.
|
static int |
unwrap(java.lang.Integer[] a,
IntIterator i,
int offset)
A Function to convert a Primitive Iterator to a Object array.
|
static int |
unwrap(java.lang.Integer[] a,
IntIterator i,
int offset,
int max)
A Function to convert a Primitive Iterator to a Object array.
|
static speiger.src.collections.ints.utils.IntIterators.ArrayIterator |
wrap(int... a)
Returns a Array Wrapping iterator
|
static speiger.src.collections.ints.utils.IntIterators.ArrayIterator |
wrap(int[] a,
int start,
int end)
Returns a Array Wrapping iterator
|
static IntIterator |
wrap(java.util.Iterator<? extends java.lang.Integer> iterator)
Helper function to convert a Object Iterator into a Primitive Iterator
|
public static speiger.src.collections.ints.utils.IntIterators.EmptyIterator empty()
public static IntBidirectionalIterator invert(IntBidirectionalIterator it)
it - the iterator that should be invertedpublic static IntListIterator invert(IntListIterator it)
it - the iterator that should be invertedpublic static IntIterator unmodifiable(IntIterator iterator)
iterator - that should be made immutable/unmodifiablepublic static IntBidirectionalIterator unmodifiable(IntBidirectionalIterator iterator)
iterator - that should be made immutable/unmodifiablepublic static IntListIterator unmodifiable(IntListIterator iterator)
iterator - that should be made immutable/unmodifiablepublic static <E> ObjectIterator<E> map(java.util.Iterator<? extends java.lang.Integer> iterator, IntFunction<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(IntIterator iterator, IntFunction<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.Integer> iterator, IntFunction<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(IntIterator iterator, IntFunction<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.Integer> iterator, IntFunction<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(IntIterator iterator, IntFunction<E[]> mapper)
E - The return type.iterator - that should be flatMappedmapper - the function that decides what the result turns into.public static IntIterator filter(java.util.Iterator<? extends java.lang.Integer> iterator, java.util.function.IntPredicate filter)
iterator - that should be filtered.filter - the filter that decides that should be let throughpublic static IntIterator filter(IntIterator iterator, java.util.function.IntPredicate filter)
iterator - that should be filtered.filter - the filter that decides that should be let throughpublic static IntIterator distinct(IntIterator iterator)
iterator - that should be distinctpublic static IntIterator distinct(java.util.Iterator<? extends java.lang.Integer> iterator)
iterator - that should be distinctpublic static IntIterator repeat(IntIterator iterator, int repeats)
iterator - that should be repeatedrepeats - the amount of times the iterator should be repeatedpublic static IntIterator repeat(java.util.Iterator<? extends java.lang.Integer> iterator, int repeats)
iterator - that should be repeatedrepeats - the amount of times the iterator should be repeatedpublic static IntIterator limit(IntIterator iterator, long limit)
iterator - that should be limitedlimit - the amount of elements it should be limited topublic static IntIterator limit(java.util.Iterator<? extends java.lang.Integer> iterator, long limit)
iterator - that should be limitedlimit - the amount of elements it should be limited topublic static IntIterator sorted(IntIterator iterator, IntComparator sorter)
iterator - that should be sorted.sorter - the sorter of the iterator. Can be null.public static IntIterator sorted(java.util.Iterator<? extends java.lang.Integer> iterator, IntComparator sorter)
iterator - that should be sorted.sorter - the sorter of the iterator. Can be null.public static IntIterator peek(IntIterator iterator, IntConsumer action)
iterator - that should be peeked ataction - callback that receives the value before the iterator returns itpublic static IntIterator peek(java.util.Iterator<? extends java.lang.Integer> iterator, IntConsumer action)
iterator - that should be peeked ataction - callback that receives the value before the iterator returns itpublic static IntIterator wrap(java.util.Iterator<? extends java.lang.Integer> iterator)
iterator - that should be converted to a unboxing iteratorpublic static speiger.src.collections.ints.utils.IntIterators.ArrayIterator wrap(int... a)
a - the array that should be wrappedpublic static speiger.src.collections.ints.utils.IntIterators.ArrayIterator wrap(int[] 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(int[] a,
java.util.Iterator<? extends java.lang.Integer> i)
a - where the elements should be insertedi - the source iteratorpublic static int unwrap(int[] a,
java.util.Iterator<? extends java.lang.Integer> i,
int offset)
a - where the elements should be insertedi - the source iteratoroffset - the array offset where the start should bepublic static int unwrap(int[] a,
java.util.Iterator<? extends java.lang.Integer> 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(int[] a,
IntIterator i)
a - where the elements should be insertedi - the source iteratorpublic static int unwrap(int[] a,
IntIterator i,
int offset)
a - where the elements should be insertedi - the source iteratoroffset - the array offset where the start should bepublic static int unwrap(int[] a,
IntIterator 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.Integer[] a,
IntIterator i)
a - where the elements should be insertedi - the source iteratorpublic static int unwrap(java.lang.Integer[] a,
IntIterator 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.Integer[] a,
IntIterator 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 IntList pour(IntIterator iter)
iter - the elements that should be poured into list.public static IntList pour(IntIterator 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(IntIterator iter, IntCollection c)
iter - the elements that should be poured into list.c - the collection where the elements should be poured intopublic static int pour(IntIterator iter, IntCollection 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 IntIterator concat(IntIterator... array)
array - the Iterators that should be concatenatedpublic static IntIterator concat(IntIterator[] array, int offset, int length)
array - the Iterators that should be concatenatedoffset - where to start within the arraylength - the length of the array