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,AbstractSynchronizedDoubleCollection,AbstractUnmodifiableDoubleCollection,ByteDoubleHashMap,CharDoubleHashMap,CollectBooleanToDoubleIterable,CollectByteToDoubleIterable,CollectCharToDoubleIterable,CollectDoubleIterable,CollectDoubleToDoubleIterable,CollectFloatToDoubleIterable,CollectIntToDoubleIterable,CollectLongToDoubleIterable,CollectShortToDoubleIterable,DoubleArrayList,DoubleArrayStack,DoubleDoubleHashMap,DoubleHashBag,DoubleHashSet,FloatDoubleHashMap,IntDoubleHashMap,LazyDoubleIterableAdapter,LongDoubleHashMap,ObjectDoubleHashMap,ObjectDoubleHashMapWithHashingStrategy,ReverseDoubleIterable,SelectDoubleIterable,ShortDoubleHashMap,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
Modifier and Type Method Description booleanallSatisfy(DoublePredicate predicate)Returns true if all of the elements in the DoubleIterable return true for the specified predicate, otherwise returns false.booleananySatisfy(DoublePredicate predicate)Returns true if any of the elements in the DoubleIterable return true for the specified predicate, otherwise returns false.LazyDoubleIterableasLazy()Returns a LazyDoubleIterable adapter wrapping the source DoubleIterable.doubleaverage()default doubleaverageIfEmpty(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 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 targetMutableBooleanCollectionwith 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 targetMutableByteCollectionwith 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 targetMutableCharCollectionwith 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 targetMutableDoubleCollectionwith 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 targetMutableFloatCollectionwith 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 targetMutableIntCollectionwith 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 targetMutableLongCollectionwith 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 targetMutableShortCollectionwith the results of applying the specified function on each element of the source collection.booleancontains(double value)Returns true if the value is contained in the DoubleIterable, and false if it is not.booleancontainsAll(double... source)Returns true if the all of the values specified in the source array are contained in the DoubleIterable, and false if they are not.booleancontainsAll(DoubleIterable source)Returns true if the all of the values specified in the source DoubleIterable are contained in the DoubleIterable, and false if they are not.intcount(DoublePredicate predicate)Returns a count of the number of elements in the DoubleIterable that return true for the specified predicate.doubledetectIfNone(DoublePredicate predicate, double ifNone)DoubleIteratordoubleIterator()Returns a primitive iterator that can be used to iterate over the DoubleIterable in an imperative style.voideach(DoubleProcedure procedure)A synonym for forEach.default <V, R extends Collection<V>>
RflatCollect(DoubleToObjectFunction<? extends Iterable<V>> function, R target)flatCollectis a special case ofcollect(DoubleToObjectFunction).voidforEach(DoubleProcedure procedure)Applies the DoubleProcedure to each element in the DoubleIterable.<T> TinjectInto(T injectedValue, ObjectDoubleToObjectFunction<? super T,? extends T> function)doublemax()doublemaxIfEmpty(double defaultValue)doublemedian()default doublemedianIfEmpty(double defaultValue)doublemin()doubleminIfEmpty(double defaultValue)booleannoneSatisfy(DoublePredicate predicate)Returns true if none of the elements in the DoubleIterable return true for the specified predicate, otherwise returns false.default doublereduce(DoubleDoubleToDoubleFunction accumulator)default doublereduceIfEmpty(DoubleDoubleToDoubleFunction accumulator, double defaultValue)DoubleIterablereject(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.DoubleIterableselect(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.doublesum()default DoubleSummaryStatisticssummaryStatistics()default DoubleIterabletap(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.MutableDoubleBagtoBag()Converts the DoubleIterable to a new MutableDoubleBag.MutableDoubleListtoList()Converts the DoubleIterable to a new MutableDoubleList.MutableDoubleSettoSet()Converts the DoubleIterable to a new MutableDoubleSet.double[]toSortedArray()MutableDoubleListtoSortedList()Methods inherited from interface org.eclipse.collections.api.PrimitiveIterable
appendString, appendString, appendString, isEmpty, makeString, makeString, makeString, notEmpty, size, toString 
- 
Method Details
- 
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
boolean containsAll(double... source)Returns true if the all of the values specified in the source array are contained in the DoubleIterable, and false if they are not. - 
containsAll
Returns true if the all of the values specified in the source DoubleIterable are contained in the DoubleIterable, and false if they are not. - 
forEach
Applies the DoubleProcedure to each element in the DoubleIterable. - 
each
A synonym for forEach.- Since:
 - 7.0.
 
 - 
tap
- Since:
 - 9.0.
 
 - 
select
Returns a new DoubleIterable with all of the elements in the DoubleIterable that return true for the specified predicate. - 
reject
Returns a new DoubleIterable with all of the elements in the DoubleIterable that return false for the specified predicate. - 
select
Same asselect(DoublePredicate), only the results are added to the target MutableDoubleCollection.- Since:
 - 8.1.
 
 - 
reject
Same asreject(DoublePredicate), only the results are added to the target MutableDoubleCollection.- Since:
 - 8.1.
 
 - 
collect
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 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 Collection<V>> R flatCollect(DoubleToObjectFunction<? extends Iterable<V>> function, R target)flatCollectis a special case ofcollect(DoubleToObjectFunction). Withcollect, when theDoubleToObjectFunctionreturns a collection, the result is a collection of collections.flatCollectoutputs 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 targetMutableBooleanCollectionwith the results of applying the specified function on each element of the source collection.- Since:
 - 8.1.
 
 - 
collectByte
Returns the targetMutableByteCollectionwith the results of applying the specified function on each element of the source collection.- Since:
 - 8.1.
 
 - 
collectChar
Returns the targetMutableCharCollectionwith 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 targetMutableShortCollectionwith the results of applying the specified function on each element of the source collection.- Since:
 - 8.1.
 
 - 
collectInt
Returns the targetMutableIntCollectionwith 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 targetMutableFloatCollectionwith the results of applying the specified function on each element of the source collection.- Since:
 - 8.1.
 
 - 
collectLong
Returns the targetMutableLongCollectionwith 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 targetMutableDoubleCollectionwith the results of applying the specified function on each element of the source collection.- Since:
 - 8.1.
 
 - 
detectIfNone
 - 
count
Returns a count of the number of elements in the DoubleIterable that return true for the specified predicate. - 
anySatisfy
Returns true if any of the elements in the DoubleIterable return true for the specified predicate, otherwise returns false. - 
allSatisfy
Returns true if all of the elements in the DoubleIterable return true for the specified predicate, otherwise returns false. - 
noneSatisfy
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
 - 
reduceIfEmpty
- Since:
 - 10.0
 - See Also:
 reduce(DoubleDoubleToDoubleFunction)
 - 
reduce
- Since:
 - 10.0
 - See Also:
 RichIterable.reduce(BinaryOperator)
 - 
chunk
Partitions elements in fixed size chunks.- Parameters:
 size- the number of elements per chunk- Returns:
 - A 
RichIterablecontainingDoubleIterables of sizesize, except the last will be truncated if the elements don't divide evenly. - Since:
 - 9.2
 
 - 
sum
double sum() - 
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() 
 -