public interface PrimitiveDoubleIterable
extends java.lang.Iterable<java.lang.Double>
Modifier and Type | Field and Description |
---|---|
static PrimitiveDoubleIterable |
EMPTY
Empty iterable of primitive double values.
|
static java.util.PrimitiveIterator.OfDouble |
EMPTY_DOUBLE_ITERATOR
Empty iterator of primitive double values.
|
Modifier and Type | Method and Description |
---|---|
default java.util.OptionalDouble |
average()
Calculate the average of all elements in this iterable.
|
default boolean |
containsDouble(double value)
Does this double iterable contain the given value?
|
default boolean |
containsDouble(double value,
double eps)
Does this float iterable contain the given value?
|
java.util.PrimitiveIterator.OfDouble |
doubleIterator()
Get a primitive double iterator.
|
default void |
forEachDouble(java.util.function.DoubleConsumer action)
Invoke the given action with each double value in this iterable.
|
default <E extends java.lang.Exception> |
forEachDoubleFragile(FragileDoubleConsumer<E> action)
Invoke the given fragile action with each value in this iterable.
|
default java.util.Iterator<java.lang.Double> |
iterator() |
default java.util.Spliterator.OfDouble |
spliterator() |
default java.util.stream.DoubleStream |
stream()
Get a stream of primitive long values from this iterable.
|
default double |
sum()
Calculate the sum of the elements of this iterable.
|
static final java.util.PrimitiveIterator.OfDouble EMPTY_DOUBLE_ITERATOR
static final PrimitiveDoubleIterable EMPTY
@NotNull java.util.PrimitiveIterator.OfDouble doubleIterator()
@NotNull default java.util.Iterator<java.lang.Double> iterator()
iterator
in interface java.lang.Iterable<java.lang.Double>
default void forEachDouble(@NotNull java.util.function.DoubleConsumer action)
action
- action to be call for each double value in sequemce.default <E extends java.lang.Exception> void forEachDoubleFragile(@NotNull FragileDoubleConsumer<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.Exception
default boolean containsDouble(double value)
value
- value to check fortrue
if the value is contained in this iterable, false
if notdefault boolean containsDouble(double value, double eps)
containsDouble(double)
this allows for a small deviation.value
- value to check foreps
- epsilon defining the possible deviation from value
which is still acceptedtrue
if this indexable contains the value within the given epsilon,
false
if notdefault double sum()
@NotNull default java.util.OptionalDouble average()
default java.util.Spliterator.OfDouble spliterator()
spliterator
in interface java.lang.Iterable<java.lang.Double>
@NotNull default java.util.stream.DoubleStream stream()
double
stream