public interface DoubleIterable extends PrimitiveIterable
| Modifier and Type | Method and 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 Collection<V>> |
collect(DoubleToObjectFunction<? extends V> function,
R target)
Same as
collect(DoubleToObjectFunction) , only the results are added to the target Collection. |
default <R extends MutableBooleanCollection> |
collectBoolean(DoubleToBooleanFunction function,
R target)
Returns the target
MutableBooleanCollection with the results of applying the specified function on each element
of the source collection. |
default <R extends MutableByteCollection> |
collectByte(DoubleToByteFunction function,
R target)
Returns the target
MutableByteCollection with the results of applying the specified function on each element
of the source collection. |
default <R extends MutableCharCollection> |
collectChar(DoubleToCharFunction function,
R target)
Returns the target
MutableCharCollection with the results of applying the specified function on each element
of the source collection. |
default <R extends MutableDoubleCollection> |
collectDouble(DoubleToDoubleFunction function,
R target)
Returns the target
MutableDoubleCollection with the results of applying the specified function on each element
of the source collection. |
default <R extends MutableFloatCollection> |
collectFloat(DoubleToFloatFunction function,
R target)
Returns the target
MutableFloatCollection with the results of applying the specified function on each element
of the source collection. |
default <R extends MutableIntCollection> |
collectInt(DoubleToIntFunction function,
R target)
Returns the target
MutableIntCollection with the results of applying the specified function on each element
of the source collection. |
default <R extends MutableLongCollection> |
collectLong(DoubleToLongFunction function,
R target)
Returns the target
MutableLongCollection with the results of applying the specified function on each element
of the source collection. |
default <R extends MutableShortCollection> |
collectShort(DoubleToShortFunction function,
R target)
Returns the target
MutableShortCollection 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 Collection<V>> |
flatCollect(DoubleToObjectFunction<? extends Iterable<V>> function,
R target)
flatCollect is a special case of collect(DoubleToObjectFunction). |
void |
forEach(DoubleProcedure procedure)
Applies the DoubleProcedure to each element in the DoubleIterable.
|
<T> T |
injectInto(T injectedValue,
ObjectDoubleToObjectFunction<? super T,? extends T> function) |
double |
max() |
double |
maxIfEmpty(double defaultValue) |
double |
median() |
default double |
medianIfEmpty(double defaultValue) |
double |
min() |
double |
minIfEmpty(double defaultValue) |
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> |
reject(DoublePredicate predicate,
R target)
Same as
reject(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> |
select(DoublePredicate predicate,
R target)
Same as
select(DoublePredicate) , only the results are added to the target MutableDoubleCollection. |
double |
sum() |
default 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
by
function. |
default <T> MutableDoubleList |
toSortedListBy(DoubleToObjectFunction<T> function,
Comparator<? super T> comparator)
Converts the collection to a MutableDoubleList implementation, which is sorted based on the key returned by
function using the provided comparator. |
appendString, appendString, appendString, isEmpty, makeString, makeString, makeString, notEmpty, size, toStringDoubleIterator doubleIterator()
double[] toArray()
default double[] toArray(double[] target)
boolean contains(double value)
default boolean containsAll(double... source)
default boolean containsAll(DoubleIterable source)
default boolean containsAny(double... source)
default boolean containsAny(DoubleIterable source)
default boolean containsNone(double... source)
default boolean containsNone(DoubleIterable source)
void forEach(DoubleProcedure procedure)
void each(DoubleProcedure procedure)
default DoubleIterable tap(DoubleProcedure procedure)
DoubleIterable select(DoublePredicate predicate)
DoubleIterable reject(DoublePredicate predicate)
default <R extends MutableDoubleCollection> R select(DoublePredicate predicate, R target)
select(DoublePredicate) , only the results are added to the target MutableDoubleCollection.default <R extends MutableDoubleCollection> R reject(DoublePredicate predicate, R target)
reject(DoublePredicate) , only the results are added to the target MutableDoubleCollection.<V> RichIterable<V> collect(DoubleToObjectFunction<? extends V> function)
default <V,R extends Collection<V>> R collect(DoubleToObjectFunction<? extends V> function, R target)
collect(DoubleToObjectFunction) , only the results are added to the target Collection.default <V,R extends Collection<V>> R flatCollect(DoubleToObjectFunction<? extends Iterable<V>> function, R target)
flatCollect is a special case of collect(DoubleToObjectFunction). With collect, when the DoubleToObjectFunction returns
a collection, the result is a collection of collections. flatCollect outputs a single "flattened" collection
instead. This method is commonly called flatMap.default <R extends MutableBooleanCollection> R collectBoolean(DoubleToBooleanFunction function, R target)
MutableBooleanCollection with the results of applying the specified function on each element
of the source collection.default <R extends MutableByteCollection> R collectByte(DoubleToByteFunction function, R target)
MutableByteCollection with the results of applying the specified function on each element
of the source collection.default <R extends MutableCharCollection> R collectChar(DoubleToCharFunction function, R target)
MutableCharCollection with the results of applying the specified function on each element
of the source collection.default <R extends MutableShortCollection> R collectShort(DoubleToShortFunction function, R target)
MutableShortCollection with the results of applying the specified function on each element
of the source collection.default <R extends MutableIntCollection> R collectInt(DoubleToIntFunction function, R target)
MutableIntCollection with the results of applying the specified function on each element
of the source collection.default <R extends MutableFloatCollection> R collectFloat(DoubleToFloatFunction function, R target)
MutableFloatCollection with the results of applying the specified function on each element
of the source collection.default <R extends MutableLongCollection> R collectLong(DoubleToLongFunction function, R target)
MutableLongCollection with the results of applying the specified function on each element
of the source collection.default <R extends MutableDoubleCollection> R collectDouble(DoubleToDoubleFunction function, R target)
MutableDoubleCollection with the results of applying the specified function on each element
of the source collection.double detectIfNone(DoublePredicate predicate, double ifNone)
int count(DoublePredicate predicate)
boolean anySatisfy(DoublePredicate predicate)
boolean allSatisfy(DoublePredicate predicate)
boolean noneSatisfy(DoublePredicate predicate)
MutableDoubleList toList()
MutableDoubleSet toSet()
MutableDoubleBag toBag()
LazyDoubleIterable asLazy()
<T> T injectInto(T injectedValue,
ObjectDoubleToObjectFunction<? super T,? extends T> function)
default double reduceIfEmpty(DoubleDoubleToDoubleFunction accumulator, double defaultValue)
reduce(DoubleDoubleToDoubleFunction)default double reduce(DoubleDoubleToDoubleFunction accumulator)
RichIterable.reduce(BinaryOperator)default RichIterable<DoubleIterable> chunk(int size)
size - the number of elements per chunkRichIterable containing DoubleIterables of size size, except the last will be
truncated if the elements don't divide evenly.double sum()
default DoubleSummaryStatistics summaryStatistics()
double max()
double maxIfEmpty(double defaultValue)
double min()
double minIfEmpty(double defaultValue)
double average()
default double averageIfEmpty(double defaultValue)
double median()
default double medianIfEmpty(double defaultValue)
double[] toSortedArray()
MutableDoubleList toSortedList()
default MutableDoubleList toSortedList(DoubleComparator comparator)
default <T> MutableDoubleList toSortedListBy(DoubleToObjectFunction<T> function)
function.default <T> MutableDoubleList toSortedListBy(DoubleToObjectFunction<T> function, Comparator<? super T> comparator)
function using the provided comparator.Copyright © 2004–2021. All rights reserved.