public interface LongIterable
extends java.lang.Iterable<java.lang.Long>
Iterable that reduces (un)boxing| Modifier and Type | Method and Description |
|---|---|
default <E> ObjectIterable<E> |
arrayflatMap(Long2ObjectFunction<E[]> mapper)
A Helper function to reduce the usage of Streams and allows to convert a Iterable to something else.
|
default LongAsyncBuilder |
asAsync()
Creates a Async Builder for moving work of the thread.
|
default int |
count(Long2BooleanFunction filter)
Helper function to reduce stream usage that allows to count the valid elements.
|
default LongIterable |
distinct()
A Helper function to reduce the usage of Streams and allows to filter out duplicated elements
|
default LongIterable |
filter(Long2BooleanFunction filter)
A Helper function to reduce the usage of Streams and allows to filter out unwanted elements
|
default long |
findFirst(Long2BooleanFunction filter)
Helper function to reduce stream usage that allows to filter for the first match.
|
default <E,V extends java.lang.Iterable<E>> |
flatMap(Long2ObjectFunction<V> mapper)
A Helper function to reduce the usage of Streams and allows to convert a Iterable to something else.
|
default void |
forEach(java.util.function.Consumer<? super java.lang.Long> action)
Deprecated.
Please use the corresponding type-specific function instead.
|
default <E> void |
forEach(E input,
ObjectLongConsumer<E> action)
Helper function to reduce Lambda usage and allow for more method references, since these are faster/cleaner.
|
default void |
forEach(LongConsumer action)
A Type Specific foreach function that reduces (un)boxing
|
LongIterator |
iterator()
Returns an iterator over elements of type
T. |
default LongIterable |
limit(long limit)
A Helper function to reduce the usage of Streams and allows to limit the amount of elements
|
default <E> ObjectIterable<E> |
map(Long2ObjectFunction<E> mapper)
A Helper function to reduce the usage of Streams and allows to convert a Iterable to something else.
|
default boolean |
matchesAll(Long2BooleanFunction filter)
Helper function to reduce stream usage that allows to filter for all matches.
|
default boolean |
matchesAny(Long2BooleanFunction filter)
Helper function to reduce stream usage that allows to filter for any matches.
|
default boolean |
matchesNone(Long2BooleanFunction filter)
Helper function to reduce stream usage that allows to filter for no matches.
|
default LongIterable |
peek(LongConsumer action)
A Helper function to reduce the usage of Streams and allows to preview elements before they are iterated through
|
default <E extends LongCollection> |
pour(E collection)
A Helper function to reduce the usage of Streams and allows to collect all elements
|
default LongList |
pourAsList()
A Helper function that reduces the usage of streams and allows to collect all elements as a ArrayList
|
default LongSet |
pourAsSet()
A Helper function that reduces the usage of streams and allows to collect all elements as a LinkedHashSet
|
default long |
reduce(long identity,
LongLongUnaryOperator operator)
Performs a reduction on the
elements of this Iterable
|
default long |
reduce(LongLongUnaryOperator operator)
Performs a reduction on the
elements of this Iterable
|
default LongIterable |
sorted(LongComparator sorter)
A Helper function to reduce the usage of Streams and allows to sort the elements
|
default LongSplititerator |
spliterator()
A Type Specific Type Splititerator to reduce boxing/unboxing
|
LongIterator iterator()
T.iterator in interface java.lang.Iterable<java.lang.Long>default void forEach(LongConsumer action)
action - The action to be performed for each elementjava.lang.NullPointerException - if the specified action is nullIterable.forEach(Consumer)The default implementation behaves as if:
iterator().forEachRemaining(action);
@Deprecated default void forEach(java.util.function.Consumer<? super java.lang.Long> action)
This default implementation delegates to the corresponding type-specific function.
forEach in interface java.lang.Iterable<java.lang.Long>default <E> void forEach(E input,
ObjectLongConsumer<E> action)
E - the generic type of the Objectinput - the object that should be includedaction - The action to be performed for each elementjava.lang.NullPointerException - if the specified action is nulldefault LongSplititerator spliterator()
spliterator in interface java.lang.Iterable<java.lang.Long>default LongAsyncBuilder asAsync()
LongAsyncBuilderdefault <E> ObjectIterable<E> map(Long2ObjectFunction<E> mapper)
E - The return type.mapper - the mapping functiondefault <E,V extends java.lang.Iterable<E>> ObjectIterable<E> flatMap(Long2ObjectFunction<V> mapper)
V - The return type supplier.E - The return type.mapper - the flatMapping functiondefault <E> ObjectIterable<E> arrayflatMap(Long2ObjectFunction<E[]> mapper)
E - The return type.mapper - the flatMapping functiondefault LongIterable filter(Long2BooleanFunction filter)
filter - the elements that should be kept.default LongIterable distinct()
default LongIterable limit(long limit)
limit - the amount of elements it should be limited todefault LongIterable sorted(LongComparator sorter)
sorter - that sorts the elements.default LongIterable peek(LongConsumer action)
action - the action that should be applieddefault <E extends LongCollection> E pour(E collection)
E - the collection typecollection - that the elements should be inserted todefault LongList pourAsList()
default LongSet pourAsSet()
default boolean matchesAny(Long2BooleanFunction filter)
filter - that should be applieddefault boolean matchesNone(Long2BooleanFunction filter)
filter - that should be applieddefault boolean matchesAll(Long2BooleanFunction filter)
filter - that should be applieddefault long findFirst(Long2BooleanFunction filter)
filter - that should be applieddefault long reduce(long identity,
LongLongUnaryOperator operator)
operator - the operation that should be appliedidentity - the start valuedefault long reduce(LongLongUnaryOperator operator)
operator - the operation that should be applieddefault int count(Long2BooleanFunction filter)
filter - that should be applied