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