Package org.eclipse.collections.api
Interface DoubleIterable
-
- All Superinterfaces:
PrimitiveIterable
- All Known Subinterfaces:
ByteDoubleMap
,CharDoubleMap
,DoubleBag
,DoubleDoubleMap
,DoubleList
,DoubleSet
,DoubleStack
,DoubleValuesMap
,FloatDoubleMap
,ImmutableByteDoubleMap
,ImmutableCharDoubleMap
,ImmutableDoubleBag
,ImmutableDoubleCollection
,ImmutableDoubleDoubleMap
,ImmutableDoubleList
,ImmutableDoubleSet
,ImmutableDoubleStack
,ImmutableFloatDoubleMap
,ImmutableIntDoubleMap
,ImmutableLongDoubleMap
,ImmutableObjectDoubleMap<K>
,ImmutableShortDoubleMap
,IntDoubleMap
,LazyDoubleIterable
,LongDoubleMap
,MutableByteDoubleMap
,MutableCharDoubleMap
,MutableDoubleBag
,MutableDoubleCollection
,MutableDoubleDoubleMap
,MutableDoubleList
,MutableDoubleSet
,MutableDoubleStack
,MutableDoubleValuesMap
,MutableFloatDoubleMap
,MutableIntDoubleMap
,MutableLongDoubleMap
,MutableObjectDoubleMap<K>
,MutableShortDoubleMap
,ObjectDoubleMap<K>
,OrderedDoubleIterable
,ReversibleDoubleIterable
,ShortDoubleMap
- All Known Implementing Classes:
AbstractDoubleIterable
,AbstractDoubleSet
,AbstractDoubleStack
,AbstractImmutableDoubleSet
,AbstractImmutableObjectDoubleMap
,AbstractLazyDoubleIterable
,AbstractMutableDoubleKeySet
,AbstractMutableDoubleValuesMap
,AbstractMutableDoubleValuesMap.AbstractDoubleValuesCollection
,AbstractSynchronizedDoubleCollection
,AbstractUnmodifiableDoubleCollection
,ByteDoubleHashMap
,ByteDoubleHashMap.ValuesCollection
,CharDoubleHashMap
,CharDoubleHashMap.ValuesCollection
,CollectBooleanToDoubleIterable
,CollectByteToDoubleIterable
,CollectCharToDoubleIterable
,CollectDoubleIterable
,CollectDoubleToDoubleIterable
,CollectFloatToDoubleIterable
,CollectIntToDoubleIterable
,CollectLongToDoubleIterable
,CollectShortToDoubleIterable
,DoubleArrayList
,DoubleArrayStack
,DoubleBooleanHashMap.KeySet
,DoubleBooleanHashMap.KeysView
,DoubleByteHashMap.KeySet
,DoubleByteHashMap.KeysView
,DoubleCharHashMap.KeySet
,DoubleCharHashMap.KeysView
,DoubleDoubleHashMap
,DoubleDoubleHashMap.KeySet
,DoubleDoubleHashMap.KeysView
,DoubleDoubleHashMap.ValuesCollection
,DoubleFloatHashMap.KeySet
,DoubleFloatHashMap.KeysView
,DoubleHashBag
,DoubleHashSet
,DoubleHashSet.ImmutableDoubleHashSet
,DoubleIntHashMap.KeySet
,DoubleIntHashMap.KeysView
,DoubleLongHashMap.KeySet
,DoubleLongHashMap.KeysView
,DoubleObjectHashMap.KeySet
,DoubleObjectHashMap.KeysView
,DoubleShortHashMap.KeySet
,DoubleShortHashMap.KeysView
,FloatDoubleHashMap
,FloatDoubleHashMap.ValuesCollection
,ImmutableByteDoubleEmptyMap
,ImmutableByteDoubleHashMap
,ImmutableByteDoubleSingletonMap
,ImmutableCharDoubleEmptyMap
,ImmutableCharDoubleHashMap
,ImmutableCharDoubleSingletonMap
,ImmutableDoubleArrayList
,ImmutableDoubleArrayStack
,ImmutableDoubleDoubleEmptyMap
,ImmutableDoubleDoubleHashMap
,ImmutableDoubleDoubleMapKeySet
,ImmutableDoubleDoubleSingletonMap
,ImmutableDoubleEmptyBag
,ImmutableDoubleEmptyList
,ImmutableDoubleEmptySet
,ImmutableDoubleEmptyStack
,ImmutableDoubleHashBag
,ImmutableDoubleMapKeySet
,ImmutableDoubleSingletonBag
,ImmutableDoubleSingletonList
,ImmutableDoubleSingletonSet
,ImmutableDoubleSingletonStack
,ImmutableFloatDoubleEmptyMap
,ImmutableFloatDoubleHashMap
,ImmutableFloatDoubleSingletonMap
,ImmutableIntDoubleEmptyMap
,ImmutableIntDoubleHashMap
,ImmutableIntDoubleSingletonMap
,ImmutableLongDoubleEmptyMap
,ImmutableLongDoubleHashMap
,ImmutableLongDoubleSingletonMap
,ImmutableObjectDoubleEmptyMap
,ImmutableObjectDoubleHashMap
,ImmutableObjectDoubleSingletonMap
,ImmutableShortDoubleEmptyMap
,ImmutableShortDoubleHashMap
,ImmutableShortDoubleSingletonMap
,IntDoubleHashMap
,IntDoubleHashMap.ValuesCollection
,LazyDoubleIterableAdapter
,LongDoubleHashMap
,LongDoubleHashMap.ValuesCollection
,ObjectDoubleHashMap
,ObjectDoubleHashMap.ValuesCollection
,ObjectDoubleHashMapWithHashingStrategy
,ObjectDoubleHashMapWithHashingStrategy.ValuesCollection
,ReverseDoubleIterable
,SelectDoubleIterable
,ShortDoubleHashMap
,ShortDoubleHashMap.ValuesCollection
,SynchronizedByteDoubleMap
,SynchronizedCharDoubleMap
,SynchronizedDoubleBag
,SynchronizedDoubleCollection
,SynchronizedDoubleDoubleMap
,SynchronizedDoubleIterable
,SynchronizedDoubleList
,SynchronizedDoubleSet
,SynchronizedDoubleStack
,SynchronizedFloatDoubleMap
,SynchronizedIntDoubleMap
,SynchronizedLongDoubleMap
,SynchronizedObjectDoubleMap
,SynchronizedShortDoubleMap
,TapDoubleIterable
,UnmodifiableByteDoubleMap
,UnmodifiableCharDoubleMap
,UnmodifiableDoubleBag
,UnmodifiableDoubleCollection
,UnmodifiableDoubleDoubleMap
,UnmodifiableDoubleList
,UnmodifiableDoubleSet
,UnmodifiableDoubleStack
,UnmodifiableFloatDoubleMap
,UnmodifiableIntDoubleMap
,UnmodifiableLongDoubleMap
,UnmodifiableObjectDoubleMap
,UnmodifiableShortDoubleMap
public interface DoubleIterable extends PrimitiveIterable
DoubleIterable is an interface which is memory-optimized for double primitives. It is inspired by the interface RichIterable, and contains a subset of the internal iterator methods on RichIterable like collect, sum, etc. The API also includes an external iterator method, which returns an DoubleIterator. DoubleIterator helps iterate over the DoubleIterable without boxing the primitives. This file was automatically generated from template file primitiveIterable.stg.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description boolean
allSatisfy(DoublePredicate predicate)
Returns true if all of the elements in the DoubleIterable return true for the specified predicate, otherwise returns false.boolean
anySatisfy(DoublePredicate predicate)
Returns true if any of the elements in the DoubleIterable return true for the specified predicate, otherwise returns false.LazyDoubleIterable
asLazy()
Returns a LazyDoubleIterable adapter wrapping the source DoubleIterable.double
average()
default double
averageIfEmpty(double defaultValue)
default RichIterable<DoubleIterable>
chunk(int size)
Partitions elements in fixed size chunks.<V> RichIterable<V>
collect(DoubleToObjectFunction<? extends V> function)
Returns a new collection with the results of applying the specified function on each element of the source collection.default <V,R extends java.util.Collection<V>>
Rcollect(DoubleToObjectFunction<? extends V> function, R target)
Same ascollect(DoubleToObjectFunction)
, only the results are added to the target Collection.default <R extends MutableBooleanCollection>
RcollectBoolean(DoubleToBooleanFunction function, R target)
Returns the targetMutableBooleanCollection
with the results of applying the specified function on each element of the source collection.default <R extends MutableByteCollection>
RcollectByte(DoubleToByteFunction function, R target)
Returns the targetMutableByteCollection
with the results of applying the specified function on each element of the source collection.default <R extends MutableCharCollection>
RcollectChar(DoubleToCharFunction function, R target)
Returns the targetMutableCharCollection
with the results of applying the specified function on each element of the source collection.default <R extends MutableDoubleCollection>
RcollectDouble(DoubleToDoubleFunction function, R target)
Returns the targetMutableDoubleCollection
with the results of applying the specified function on each element of the source collection.default <R extends MutableFloatCollection>
RcollectFloat(DoubleToFloatFunction function, R target)
Returns the targetMutableFloatCollection
with the results of applying the specified function on each element of the source collection.default <R extends MutableIntCollection>
RcollectInt(DoubleToIntFunction function, R target)
Returns the targetMutableIntCollection
with the results of applying the specified function on each element of the source collection.default <R extends MutableLongCollection>
RcollectLong(DoubleToLongFunction function, R target)
Returns the targetMutableLongCollection
with the results of applying the specified function on each element of the source collection.default <R extends MutableShortCollection>
RcollectShort(DoubleToShortFunction function, R target)
Returns the targetMutableShortCollection
with the results of applying the specified function on each element of the source collection.boolean
contains(double value)
Returns true if the value is contained in the DoubleIterable, and false if it is not.default boolean
containsAll(double... source)
Returns true if all of the values specified in the source array are contained in the DoubleIterable, and false if they are not.default boolean
containsAll(DoubleIterable source)
Returns true if all of the values specified in the source DoubleIterable are contained in the DoubleIterable, and false if they are not.default boolean
containsAny(double... source)
Returns true if any of the values specified in the source array are contained in the DoubleIterable, and false if they are not.default boolean
containsAny(DoubleIterable source)
Returns true if any of the values specified in the source DoubleIterable are contained in the DoubleIterable, and false if they are not.default boolean
containsNone(double... source)
Returns true if none of the values specified in the source array are contained in the DoubleIterable, and false if they are.default boolean
containsNone(DoubleIterable source)
Returns true if none of the values specified in the source DoubleIterable are contained in the DoubleIterable, and false if they are.int
count(DoublePredicate predicate)
Returns a count of the number of elements in the DoubleIterable that return true for the specified predicate.double
detectIfNone(DoublePredicate predicate, double ifNone)
DoubleIterator
doubleIterator()
Returns a primitive iterator that can be used to iterate over the DoubleIterable in an imperative style.void
each(DoubleProcedure procedure)
A synonym for forEach.default <V,R extends java.util.Collection<V>>
RflatCollect(DoubleToObjectFunction<? extends java.lang.Iterable<V>> function, R target)
flatCollect
is a special case ofcollect(DoubleToObjectFunction)
.default void
forEach(DoubleProcedure procedure)
Applies the DoubleProcedure to each element in the DoubleIterable.<T> T
injectInto(T injectedValue, ObjectDoubleToObjectFunction<? super T,? extends T> function)
default boolean
injectIntoBoolean(boolean injectedValue, BooleanDoubleToBooleanFunction function)
Returns the final boolean result of evaluating function using each element of the iterable and the previous evaluation result as the parameters.default byte
injectIntoByte(byte injectedValue, ByteDoubleToByteFunction function)
Returns the final byte result of evaluating function using each element of the iterable and the previous evaluation result as the parameters.default char
injectIntoChar(char injectedValue, CharDoubleToCharFunction function)
Returns the final char result of evaluating function using each element of the iterable and the previous evaluation result as the parameters.default double
injectIntoDouble(double injectedValue, DoubleDoubleToDoubleFunction function)
Returns the final double result of evaluating function using each element of the iterable and the previous evaluation result as the parameters.default float
injectIntoFloat(float injectedValue, FloatDoubleToFloatFunction function)
Returns the final float result of evaluating function using each element of the iterable and the previous evaluation result as the parameters.default int
injectIntoInt(int injectedValue, IntDoubleToIntFunction function)
Returns the final int result of evaluating function using each element of the iterable and the previous evaluation result as the parameters.default long
injectIntoLong(long injectedValue, LongDoubleToLongFunction function)
Returns the final long result of evaluating function using each element of the iterable and the previous evaluation result as the parameters.default short
injectIntoShort(short injectedValue, ShortDoubleToShortFunction function)
Returns the final short result of evaluating function using each element of the iterable and the previous evaluation result as the parameters.double
max()
double
maxIfEmpty(double defaultValue)
double
median()
default double
medianIfEmpty(double defaultValue)
double
min()
double
minIfEmpty(double defaultValue)
default boolean
noneSatisfy(DoublePredicate predicate)
Returns true if none of the elements in the DoubleIterable return true for the specified predicate, otherwise returns false.default double
reduce(DoubleDoubleToDoubleFunction accumulator)
default double
reduceIfEmpty(DoubleDoubleToDoubleFunction accumulator, double defaultValue)
DoubleIterable
reject(DoublePredicate predicate)
Returns a new DoubleIterable with all of the elements in the DoubleIterable that return false for the specified predicate.default <R extends MutableDoubleCollection>
Rreject(DoublePredicate predicate, R target)
Same asreject(DoublePredicate)
, only the results are added to the target MutableDoubleCollection.DoubleIterable
select(DoublePredicate predicate)
Returns a new DoubleIterable with all of the elements in the DoubleIterable that return true for the specified predicate.default <R extends MutableDoubleCollection>
Rselect(DoublePredicate predicate, R target)
Same asselect(DoublePredicate)
, only the results are added to the target MutableDoubleCollection.double
sum()
default java.util.DoubleSummaryStatistics
summaryStatistics()
default DoubleIterable
tap(DoubleProcedure procedure)
double[]
toArray()
Converts the DoubleIterable to a primitive double array.default double[]
toArray(double[] target)
Converts the DoubleIterable to a primitive double array.MutableDoubleBag
toBag()
Converts the DoubleIterable to a new MutableDoubleBag.MutableDoubleList
toList()
Converts the DoubleIterable to a new MutableDoubleList.MutableDoubleSet
toSet()
Converts the DoubleIterable to a new MutableDoubleSet.double[]
toSortedArray()
MutableDoubleList
toSortedList()
default MutableDoubleList
toSortedList(DoubleComparator comparator)
Converts the collection to a MutableDoubleList implementation sorted using the provided comparator.default <T> MutableDoubleList
toSortedListBy(DoubleToObjectFunction<T> function)
Converts the collection to a MutableDoubleListImplementation sorted based on the natural order of the key returned byfunction
.default <T> MutableDoubleList
toSortedListBy(DoubleToObjectFunction<T> function, java.util.Comparator<? super T> comparator)
Converts the collection to a MutableDoubleList implementation, which is sorted based on the key returned byfunction
using the providedcomparator
.-
Methods inherited from interface org.eclipse.collections.api.PrimitiveIterable
appendString, appendString, appendString, isEmpty, makeString, makeString, makeString, notEmpty, size, toString
-
-
-
-
Method Detail
-
doubleIterator
DoubleIterator doubleIterator()
Returns a primitive iterator that can be used to iterate over the DoubleIterable in an imperative style.
-
toArray
double[] toArray()
Converts the DoubleIterable to a primitive double array.
-
toArray
default double[] toArray(double[] target)
Converts the DoubleIterable to a primitive double array. If the collection fits into the provided array it is used to store its elements and is returned from the method, otherwise a new array of the appropriate size is allocated and returned. If the iterable is empty, the target array is returned unchanged.
-
contains
boolean contains(double value)
Returns true if the value is contained in the DoubleIterable, and false if it is not.
-
containsAll
default boolean containsAll(double... source)
Returns true if all of the values specified in the source array are contained in the DoubleIterable, and false if they are not.
-
containsAll
default boolean containsAll(DoubleIterable source)
Returns true if all of the values specified in the source DoubleIterable are contained in the DoubleIterable, and false if they are not.
-
containsAny
default boolean containsAny(double... source)
Returns true if any of the values specified in the source array are contained in the DoubleIterable, and false if they are not.- Since:
- 11.0
-
containsAny
default boolean containsAny(DoubleIterable source)
Returns true if any of the values specified in the source DoubleIterable are contained in the DoubleIterable, and false if they are not.- Since:
- 11.0
-
containsNone
default boolean containsNone(double... source)
Returns true if none of the values specified in the source array are contained in the DoubleIterable, and false if they are.- Since:
- 11.0
-
containsNone
default boolean containsNone(DoubleIterable source)
Returns true if none of the values specified in the source DoubleIterable are contained in the DoubleIterable, and false if they are.- Since:
- 11.0
-
forEach
default void forEach(DoubleProcedure procedure)
Applies the DoubleProcedure to each element in the DoubleIterable.
-
each
void each(DoubleProcedure procedure)
A synonym for forEach.- Since:
- 7.0.
-
tap
default DoubleIterable tap(DoubleProcedure procedure)
- Since:
- 9.0.
-
select
DoubleIterable select(DoublePredicate predicate)
Returns a new DoubleIterable with all of the elements in the DoubleIterable that return true for the specified predicate.
-
reject
DoubleIterable reject(DoublePredicate predicate)
Returns a new DoubleIterable with all of the elements in the DoubleIterable that return false for the specified predicate.
-
select
default <R extends MutableDoubleCollection> R select(DoublePredicate predicate, R target)
Same asselect(DoublePredicate)
, only the results are added to the target MutableDoubleCollection.- Since:
- 8.1.
-
reject
default <R extends MutableDoubleCollection> R reject(DoublePredicate predicate, R target)
Same asreject(DoublePredicate)
, only the results are added to the target MutableDoubleCollection.- Since:
- 8.1.
-
collect
<V> RichIterable<V> collect(DoubleToObjectFunction<? extends V> function)
Returns a new collection with the results of applying the specified function on each element of the source collection. This method is also commonly called transform or map.
-
collect
default <V,R extends java.util.Collection<V>> R collect(DoubleToObjectFunction<? extends V> function, R target)
Same ascollect(DoubleToObjectFunction)
, only the results are added to the target Collection.- Since:
- 8.1.
-
flatCollect
default <V,R extends java.util.Collection<V>> R flatCollect(DoubleToObjectFunction<? extends java.lang.Iterable<V>> function, R target)
flatCollect
is a special case ofcollect(DoubleToObjectFunction)
. Withcollect
, when theDoubleToObjectFunction
returns a collection, the result is a collection of collections.flatCollect
outputs a single "flattened" collection instead. This method is commonly called flatMap.- Since:
- 8.1.
-
collectBoolean
default <R extends MutableBooleanCollection> R collectBoolean(DoubleToBooleanFunction function, R target)
Returns the targetMutableBooleanCollection
with the results of applying the specified function on each element of the source collection.- Since:
- 8.1.
-
collectByte
default <R extends MutableByteCollection> R collectByte(DoubleToByteFunction function, R target)
Returns the targetMutableByteCollection
with the results of applying the specified function on each element of the source collection.- Since:
- 8.1.
-
collectChar
default <R extends MutableCharCollection> R collectChar(DoubleToCharFunction function, R target)
Returns the targetMutableCharCollection
with the results of applying the specified function on each element of the source collection.- Since:
- 8.1.
-
collectShort
default <R extends MutableShortCollection> R collectShort(DoubleToShortFunction function, R target)
Returns the targetMutableShortCollection
with the results of applying the specified function on each element of the source collection.- Since:
- 8.1.
-
collectInt
default <R extends MutableIntCollection> R collectInt(DoubleToIntFunction function, R target)
Returns the targetMutableIntCollection
with the results of applying the specified function on each element of the source collection.- Since:
- 8.1.
-
collectFloat
default <R extends MutableFloatCollection> R collectFloat(DoubleToFloatFunction function, R target)
Returns the targetMutableFloatCollection
with the results of applying the specified function on each element of the source collection.- Since:
- 8.1.
-
collectLong
default <R extends MutableLongCollection> R collectLong(DoubleToLongFunction function, R target)
Returns the targetMutableLongCollection
with the results of applying the specified function on each element of the source collection.- Since:
- 8.1.
-
collectDouble
default <R extends MutableDoubleCollection> R collectDouble(DoubleToDoubleFunction function, R target)
Returns the targetMutableDoubleCollection
with the results of applying the specified function on each element of the source collection.- Since:
- 8.1.
-
detectIfNone
double detectIfNone(DoublePredicate predicate, double ifNone)
-
count
int count(DoublePredicate predicate)
Returns a count of the number of elements in the DoubleIterable that return true for the specified predicate.
-
anySatisfy
boolean anySatisfy(DoublePredicate predicate)
Returns true if any of the elements in the DoubleIterable return true for the specified predicate, otherwise returns false.
-
allSatisfy
boolean allSatisfy(DoublePredicate predicate)
Returns true if all of the elements in the DoubleIterable return true for the specified predicate, otherwise returns false.
-
noneSatisfy
default boolean noneSatisfy(DoublePredicate predicate)
Returns true if none of the elements in the DoubleIterable return true for the specified predicate, otherwise returns false.
-
toList
MutableDoubleList toList()
Converts the DoubleIterable to a new MutableDoubleList.
-
toSet
MutableDoubleSet toSet()
Converts the DoubleIterable to a new MutableDoubleSet.
-
toBag
MutableDoubleBag toBag()
Converts the DoubleIterable to a new MutableDoubleBag.
-
asLazy
LazyDoubleIterable asLazy()
Returns a LazyDoubleIterable adapter wrapping the source DoubleIterable.
-
injectInto
<T> T injectInto(T injectedValue, ObjectDoubleToObjectFunction<? super T,? extends T> function)
-
injectIntoBoolean
default boolean injectIntoBoolean(boolean injectedValue, BooleanDoubleToBooleanFunction function)
Returns the final boolean result of evaluating function using each element of the iterable and the previous evaluation result as the parameters. The injected value is used for the first parameter of the first evaluation, and the current item in the iterable is used as the second parameter.- Since:
- 11.1
-
injectIntoByte
default byte injectIntoByte(byte injectedValue, ByteDoubleToByteFunction function)
Returns the final byte result of evaluating function using each element of the iterable and the previous evaluation result as the parameters. The injected value is used for the first parameter of the first evaluation, and the current item in the iterable is used as the second parameter.- Since:
- 11.1
-
injectIntoChar
default char injectIntoChar(char injectedValue, CharDoubleToCharFunction function)
Returns the final char result of evaluating function using each element of the iterable and the previous evaluation result as the parameters. The injected value is used for the first parameter of the first evaluation, and the current item in the iterable is used as the second parameter.- Since:
- 11.1
-
injectIntoShort
default short injectIntoShort(short injectedValue, ShortDoubleToShortFunction function)
Returns the final short result of evaluating function using each element of the iterable and the previous evaluation result as the parameters. The injected value is used for the first parameter of the first evaluation, and the current item in the iterable is used as the second parameter.- Since:
- 11.1
-
injectIntoInt
default int injectIntoInt(int injectedValue, IntDoubleToIntFunction function)
Returns the final int result of evaluating function using each element of the iterable and the previous evaluation result as the parameters. The injected value is used for the first parameter of the first evaluation, and the current item in the iterable is used as the second parameter.- Since:
- 11.1
-
injectIntoFloat
default float injectIntoFloat(float injectedValue, FloatDoubleToFloatFunction function)
Returns the final float result of evaluating function using each element of the iterable and the previous evaluation result as the parameters. The injected value is used for the first parameter of the first evaluation, and the current item in the iterable is used as the second parameter.- Since:
- 11.1
-
injectIntoLong
default long injectIntoLong(long injectedValue, LongDoubleToLongFunction function)
Returns the final long result of evaluating function using each element of the iterable and the previous evaluation result as the parameters. The injected value is used for the first parameter of the first evaluation, and the current item in the iterable is used as the second parameter.- Since:
- 11.1
-
injectIntoDouble
default double injectIntoDouble(double injectedValue, DoubleDoubleToDoubleFunction function)
Returns the final double result of evaluating function using each element of the iterable and the previous evaluation result as the parameters. The injected value is used for the first parameter of the first evaluation, and the current item in the iterable is used as the second parameter.- Since:
- 11.1
-
reduceIfEmpty
default double reduceIfEmpty(DoubleDoubleToDoubleFunction accumulator, double defaultValue)
- Since:
- 10.0
- See Also:
reduce(DoubleDoubleToDoubleFunction)
-
reduce
default double reduce(DoubleDoubleToDoubleFunction accumulator)
- Since:
- 10.0
- See Also:
RichIterable.reduce(BinaryOperator)
-
chunk
default RichIterable<DoubleIterable> chunk(int size)
Partitions elements in fixed size chunks.- Parameters:
size
- the number of elements per chunk- Returns:
- A
RichIterable
containingDoubleIterable
s of sizesize
, except the last will be truncated if the elements don't divide evenly. - Since:
- 9.2
-
sum
double sum()
-
summaryStatistics
default java.util.DoubleSummaryStatistics summaryStatistics()
- Since:
- 8.0
-
max
double max()
-
maxIfEmpty
double maxIfEmpty(double defaultValue)
-
min
double min()
-
minIfEmpty
double minIfEmpty(double defaultValue)
-
average
double average()
-
averageIfEmpty
default double averageIfEmpty(double defaultValue)
- Since:
- 9.0
-
median
double median()
-
medianIfEmpty
default double medianIfEmpty(double defaultValue)
- Since:
- 9.0
-
toSortedArray
double[] toSortedArray()
-
toSortedList
MutableDoubleList toSortedList()
-
toSortedList
default MutableDoubleList toSortedList(DoubleComparator comparator)
Converts the collection to a MutableDoubleList implementation sorted using the provided comparator.
-
toSortedListBy
default <T> MutableDoubleList toSortedListBy(DoubleToObjectFunction<T> function)
Converts the collection to a MutableDoubleListImplementation sorted based on the natural order of the key returned byfunction
.
-
toSortedListBy
default <T> MutableDoubleList toSortedListBy(DoubleToObjectFunction<T> function, java.util.Comparator<? super T> comparator)
Converts the collection to a MutableDoubleList implementation, which is sorted based on the key returned byfunction
using the providedcomparator
.
-
-