public interface BooleanIterable extends PrimitiveIterable
| Modifier and Type | Method and Description |
|---|---|
boolean |
allSatisfy(BooleanPredicate predicate)
Returns true if all of the elements in the BooleanIterable return true for the
specified predicate, otherwise returns false.
|
boolean |
anySatisfy(BooleanPredicate predicate)
Returns true if any of the elements in the BooleanIterable return true for the
specified predicate, otherwise returns false.
|
LazyBooleanIterable |
asLazy()
Returns a LazyBooleanIterable adapter wrapping the source BooleanIterable.
|
BooleanIterator |
booleanIterator()
Returns a primitive iterator that can be used to iterate over the BooleanIterable in an
imperative style.
|
default RichIterable<BooleanIterable> |
chunk(int size)
Partitions elements in fixed size chunks.
|
<V> RichIterable<V> |
collect(BooleanToObjectFunction<? 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(BooleanToObjectFunction<? extends V> function,
R target)
Same as
collect(BooleanToObjectFunction) , only the results are added to the target Collection. |
default <R extends MutableBooleanCollection> |
collectBoolean(BooleanToBooleanFunction 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(BooleanToByteFunction 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(BooleanToCharFunction 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(BooleanToDoubleFunction 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(BooleanToFloatFunction 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(BooleanToIntFunction 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(BooleanToLongFunction 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(BooleanToShortFunction function,
R target)
Returns the target
MutableShortCollection with the results of applying the specified function on each element
of the source collection. |
boolean |
contains(boolean value)
Returns true if the value is contained in the BooleanIterable, and false if it is not.
|
default boolean |
containsAll(boolean... source)
Returns true if all of the values specified in the source array are contained
in the BooleanIterable, and false if they are not.
|
default boolean |
containsAll(BooleanIterable source)
Returns true if all of the values specified in the source BooleanIterable are contained
in the BooleanIterable, and false if they are not.
|
default boolean |
containsAny(boolean... source)
Returns true if any of the values specified in the source array are contained
in the BooleanIterable, and false if they are not.
|
default boolean |
containsAny(BooleanIterable source)
Returns true if any of the values specified in the source BooleanIterable are contained
in the BooleanIterable, and false if they are not.
|
default boolean |
containsNone(boolean... source)
Returns true if none of the values specified in the source array are contained
in the BooleanIterable, and false if they are.
|
default boolean |
containsNone(BooleanIterable source)
Returns true if none of the values specified in the source BooleanIterable are contained
in the BooleanIterable, and false if they are.
|
int |
count(BooleanPredicate predicate)
Returns a count of the number of elements in the BooleanIterable that return true for the
specified predicate.
|
boolean |
detectIfNone(BooleanPredicate predicate,
boolean ifNone) |
void |
each(BooleanProcedure procedure)
A synonym for forEach.
|
default <V,R extends Collection<V>> |
flatCollect(BooleanToObjectFunction<? extends Iterable<V>> function,
R target)
flatCollect is a special case of collect(BooleanToObjectFunction). |
default void |
forEach(BooleanProcedure procedure)
Applies the BooleanProcedure to each element in the BooleanIterable.
|
<T> T |
injectInto(T injectedValue,
ObjectBooleanToObjectFunction<? super T,? extends T> function) |
default boolean |
injectIntoBoolean(boolean injectedValue,
BooleanBooleanToBooleanFunction 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,
ByteBooleanToByteFunction 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,
CharBooleanToCharFunction 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,
DoubleBooleanToDoubleFunction 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,
FloatBooleanToFloatFunction 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,
IntBooleanToIntFunction 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,
LongBooleanToLongFunction 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,
ShortBooleanToShortFunction function)
Returns the final short result of evaluating function using each element of the iterable and the previous evaluation
result as the parameters.
|
default boolean |
noneSatisfy(BooleanPredicate predicate)
Returns true if none of the elements in the BooleanIterable return true for the
specified predicate, otherwise returns false.
|
default boolean |
reduce(BooleanBooleanToBooleanFunction accumulator) |
default boolean |
reduceIfEmpty(BooleanBooleanToBooleanFunction accumulator,
boolean defaultValue) |
BooleanIterable |
reject(BooleanPredicate predicate)
Returns a new BooleanIterable with all of the elements in the BooleanIterable that
return false for the specified predicate.
|
default <R extends MutableBooleanCollection> |
reject(BooleanPredicate predicate,
R target)
Same as
reject(BooleanPredicate) , only the results are added to the target MutableBooleanCollection. |
BooleanIterable |
select(BooleanPredicate predicate)
Returns a new BooleanIterable with all of the elements in the BooleanIterable that
return true for the specified predicate.
|
default <R extends MutableBooleanCollection> |
select(BooleanPredicate predicate,
R target)
Same as
select(BooleanPredicate) , only the results are added to the target MutableBooleanCollection. |
default BooleanIterable |
tap(BooleanProcedure procedure) |
boolean[] |
toArray()
Converts the BooleanIterable to a primitive boolean array.
|
default boolean[] |
toArray(boolean[] target)
Converts the BooleanIterable to a primitive boolean array.
|
MutableBooleanBag |
toBag()
Converts the BooleanIterable to a new MutableBooleanBag.
|
MutableBooleanList |
toList()
Converts the BooleanIterable to a new MutableBooleanList.
|
MutableBooleanSet |
toSet()
Converts the BooleanIterable to a new MutableBooleanSet.
|
appendString, appendString, appendString, isEmpty, makeString, makeString, makeString, notEmpty, size, toStringBooleanIterator booleanIterator()
boolean[] toArray()
default boolean[] toArray(boolean[] target)
boolean contains(boolean value)
default boolean containsAll(boolean... source)
default boolean containsAll(BooleanIterable source)
default boolean containsAny(boolean... source)
default boolean containsAny(BooleanIterable source)
default boolean containsNone(boolean... source)
default boolean containsNone(BooleanIterable source)
default void forEach(BooleanProcedure procedure)
void each(BooleanProcedure procedure)
default BooleanIterable tap(BooleanProcedure procedure)
BooleanIterable select(BooleanPredicate predicate)
BooleanIterable reject(BooleanPredicate predicate)
default <R extends MutableBooleanCollection> R select(BooleanPredicate predicate, R target)
select(BooleanPredicate) , only the results are added to the target MutableBooleanCollection.default <R extends MutableBooleanCollection> R reject(BooleanPredicate predicate, R target)
reject(BooleanPredicate) , only the results are added to the target MutableBooleanCollection.<V> RichIterable<V> collect(BooleanToObjectFunction<? extends V> function)
default <V,R extends Collection<V>> R collect(BooleanToObjectFunction<? extends V> function, R target)
collect(BooleanToObjectFunction) , only the results are added to the target Collection.default <V,R extends Collection<V>> R flatCollect(BooleanToObjectFunction<? extends Iterable<V>> function, R target)
flatCollect is a special case of collect(BooleanToObjectFunction). With collect, when the BooleanToObjectFunction 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(BooleanToBooleanFunction 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(BooleanToByteFunction 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(BooleanToCharFunction 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(BooleanToShortFunction 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(BooleanToIntFunction 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(BooleanToFloatFunction 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(BooleanToLongFunction 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(BooleanToDoubleFunction function, R target)
MutableDoubleCollection with the results of applying the specified function on each element
of the source collection.boolean detectIfNone(BooleanPredicate predicate, boolean ifNone)
int count(BooleanPredicate predicate)
boolean anySatisfy(BooleanPredicate predicate)
boolean allSatisfy(BooleanPredicate predicate)
default boolean noneSatisfy(BooleanPredicate predicate)
MutableBooleanList toList()
MutableBooleanSet toSet()
MutableBooleanBag toBag()
LazyBooleanIterable asLazy()
<T> T injectInto(T injectedValue,
ObjectBooleanToObjectFunction<? super T,? extends T> function)
default boolean injectIntoBoolean(boolean injectedValue,
BooleanBooleanToBooleanFunction function)
default byte injectIntoByte(byte injectedValue,
ByteBooleanToByteFunction function)
default char injectIntoChar(char injectedValue,
CharBooleanToCharFunction function)
default short injectIntoShort(short injectedValue,
ShortBooleanToShortFunction function)
default int injectIntoInt(int injectedValue,
IntBooleanToIntFunction function)
default float injectIntoFloat(float injectedValue,
FloatBooleanToFloatFunction function)
default long injectIntoLong(long injectedValue,
LongBooleanToLongFunction function)
default double injectIntoDouble(double injectedValue,
DoubleBooleanToDoubleFunction function)
default boolean reduceIfEmpty(BooleanBooleanToBooleanFunction accumulator, boolean defaultValue)
reduce(BooleanBooleanToBooleanFunction)default boolean reduce(BooleanBooleanToBooleanFunction accumulator)
RichIterable.reduce(BinaryOperator)default RichIterable<BooleanIterable> chunk(int size)
size - the number of elements per chunkRichIterable containing BooleanIterables of size size, except the last will be
truncated if the elements don't divide evenly.Copyright © 2004–2023. All rights reserved.