public interface PrimitiveLongIterable
extends java.lang.Iterable<java.lang.Long>
for creating one on the fly| Modifier and Type | Field and Description |
|---|---|
static PrimitiveLongIterable |
EMPTY
Empty iterable of primitive long values.
|
static java.util.PrimitiveIterator.OfLong |
EMPTY_LONG_ITERATOR
Empty iterator of primitive long values.
|
| Modifier and Type | Method and Description |
|---|---|
default java.util.OptionalDouble |
average()
Calculate the average of all elements in this iterable.
|
default boolean |
containsLong(long value)
Does this long iterable contain the given value?
|
default void |
forEachLong(java.util.function.LongConsumer action)
Invoke the given action with each long value in this iterable.
|
default <E extends java.lang.Exception> |
forEachLongFragile(FragileLongConsumer<E> action)
Invoke the given fragile action with each value in this iterable.
|
default java.util.Iterator<java.lang.Long> |
iterator() |
java.util.PrimitiveIterator.OfLong |
longIterator()
Get a primitive long iterator.
|
default java.util.Spliterator.OfLong |
spliterator() |
default java.util.stream.LongStream |
stream()
Get a stream of primitive long values from this iterable.
|
default long |
sum()
Calculate the sum of the elements of this iterable as a long value.
|
default long |
sumX()
Calculate the sum of the elements of this iterable as a long value.
|
static final java.util.PrimitiveIterator.OfLong EMPTY_LONG_ITERATOR
static final PrimitiveLongIterable EMPTY
@NotNull java.util.PrimitiveIterator.OfLong longIterator()
@NotNull default java.util.Iterator<java.lang.Long> iterator()
iterator in interface java.lang.Iterable<java.lang.Long>default void forEachLong(@NotNull java.util.function.LongConsumer action)
action - action to be call for each long value in sequemce.default <E extends java.lang.Exception> void forEachLongFragile(@NotNull FragileLongConsumer<E> action) throws E extends java.lang.Exception
E - checked exception thrown by actionaction - action to be called for each value in sequenceE - if action throws itE extends java.lang.Exceptiondefault boolean containsLong(long value)
value - value to check fortrue if the value is contained in this iterable, false if notdefault long sum()
default long sumX()
long.@NotNull default java.util.OptionalDouble average()
Double.NaN if this iterable is emptsdefault java.util.Spliterator.OfLong spliterator()
spliterator in interface java.lang.Iterable<java.lang.Long>@NotNull default java.util.stream.LongStream stream()
long stream