public interface IntIterable extends PrimitiveIterable
| Modifier and Type | Method and Description |
|---|---|
boolean |
allSatisfy(IntPredicate predicate)
Returns true if all of the elements in the IntIterable return true for the
specified predicate, otherwise returns false.
|
boolean |
anySatisfy(IntPredicate predicate)
Returns true if any of the elements in the IntIterable return true for the
specified predicate, otherwise returns false.
|
LazyIntIterable |
asLazy()
Returns a LazyIntIterable adapter wrapping the source IntIterable.
|
double |
average() |
default double |
averageIfEmpty(double defaultValue) |
default RichIterable<IntIterable> |
chunk(int size)
Partitions elements in fixed size chunks.
|
<V> RichIterable<V> |
collect(IntToObjectFunction<? 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(IntToObjectFunction<? extends V> function,
R target)
Same as
collect(IntToObjectFunction) , only the results are added to the target Collection. |
default <R extends MutableBooleanCollection> |
collectBoolean(IntToBooleanFunction 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(IntToByteFunction 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(IntToCharFunction 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(IntToDoubleFunction 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(IntToFloatFunction 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(IntToIntFunction 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(IntToLongFunction 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(IntToShortFunction function,
R target)
Returns the target
MutableShortCollection with the results of applying the specified function on each element
of the source collection. |
boolean |
contains(int value)
Returns true if the value is contained in the IntIterable, and false if it is not.
|
default boolean |
containsAll(int... source)
Returns true if all of the values specified in the source array are contained
in the IntIterable, and false if they are not.
|
default boolean |
containsAll(IntIterable source)
Returns true if all of the values specified in the source IntIterable are contained
in the IntIterable, and false if they are not.
|
default boolean |
containsAny(int... source)
Returns true if any of the values specified in the source array are contained
in the IntIterable, and false if they are not.
|
default boolean |
containsAny(IntIterable source)
Returns true if any of the values specified in the source IntIterable are contained
in the IntIterable, and false if they are not.
|
default boolean |
containsNone(int... source)
Returns true if none of the values specified in the source array are contained
in the IntIterable, and false if they are.
|
default boolean |
containsNone(IntIterable source)
Returns true if none of the values specified in the source IntIterable are contained
in the IntIterable, and false if they are.
|
int |
count(IntPredicate predicate)
Returns a count of the number of elements in the IntIterable that return true for the
specified predicate.
|
int |
detectIfNone(IntPredicate predicate,
int ifNone) |
void |
each(IntProcedure procedure)
A synonym for forEach.
|
default <V,R extends Collection<V>> |
flatCollect(IntToObjectFunction<? extends Iterable<V>> function,
R target)
flatCollect is a special case of collect(IntToObjectFunction). |
default void |
forEach(IntProcedure procedure)
Applies the IntProcedure to each element in the IntIterable.
|
<T> T |
injectInto(T injectedValue,
ObjectIntToObjectFunction<? super T,? extends T> function) |
default boolean |
injectIntoBoolean(boolean injectedValue,
BooleanIntToBooleanFunction 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,
ByteIntToByteFunction 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,
CharIntToCharFunction 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,
DoubleIntToDoubleFunction 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,
FloatIntToFloatFunction 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,
IntIntToIntFunction 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,
LongIntToLongFunction 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,
ShortIntToShortFunction function)
Returns the final short result of evaluating function using each element of the iterable and the previous evaluation
result as the parameters.
|
IntIterator |
intIterator()
Returns a primitive iterator that can be used to iterate over the IntIterable in an
imperative style.
|
int |
max() |
int |
maxIfEmpty(int defaultValue) |
double |
median() |
default double |
medianIfEmpty(double defaultValue) |
int |
min() |
int |
minIfEmpty(int defaultValue) |
default boolean |
noneSatisfy(IntPredicate predicate)
Returns true if none of the elements in the IntIterable return true for the
specified predicate, otherwise returns false.
|
default long |
reduce(LongIntToLongFunction accumulator) |
default long |
reduceIfEmpty(LongIntToLongFunction accumulator,
long defaultValue) |
IntIterable |
reject(IntPredicate predicate)
Returns a new IntIterable with all of the elements in the IntIterable that
return false for the specified predicate.
|
default <R extends MutableIntCollection> |
reject(IntPredicate predicate,
R target)
Same as
reject(IntPredicate) , only the results are added to the target MutableIntCollection. |
IntIterable |
select(IntPredicate predicate)
Returns a new IntIterable with all of the elements in the IntIterable that
return true for the specified predicate.
|
default <R extends MutableIntCollection> |
select(IntPredicate predicate,
R target)
Same as
select(IntPredicate) , only the results are added to the target MutableIntCollection. |
long |
sum() |
default IntSummaryStatistics |
summaryStatistics() |
default IntIterable |
tap(IntProcedure procedure) |
int[] |
toArray()
Converts the IntIterable to a primitive int array.
|
default int[] |
toArray(int[] target)
Converts the IntIterable to a primitive int array.
|
MutableIntBag |
toBag()
Converts the IntIterable to a new MutableIntBag.
|
MutableIntList |
toList()
Converts the IntIterable to a new MutableIntList.
|
MutableIntSet |
toSet()
Converts the IntIterable to a new MutableIntSet.
|
int[] |
toSortedArray() |
MutableIntList |
toSortedList() |
default MutableIntList |
toSortedList(IntComparator comparator)
Converts the collection to a MutableIntList implementation sorted using the provided comparator.
|
default <T> MutableIntList |
toSortedListBy(IntToObjectFunction<T> function)
Converts the collection to a MutableIntListImplementation sorted based on the natural order of the key returned
by
function. |
default <T> MutableIntList |
toSortedListBy(IntToObjectFunction<T> function,
Comparator<? super T> comparator)
Converts the collection to a MutableIntList implementation, which is sorted based on the key returned by
function using the provided comparator. |
appendString, appendString, appendString, isEmpty, makeString, makeString, makeString, notEmpty, size, toStringIntIterator intIterator()
int[] toArray()
default int[] toArray(int[] target)
boolean contains(int value)
default boolean containsAll(int... source)
default boolean containsAll(IntIterable source)
default boolean containsAny(int... source)
default boolean containsAny(IntIterable source)
default boolean containsNone(int... source)
default boolean containsNone(IntIterable source)
default void forEach(IntProcedure procedure)
void each(IntProcedure procedure)
default IntIterable tap(IntProcedure procedure)
IntIterable select(IntPredicate predicate)
IntIterable reject(IntPredicate predicate)
default <R extends MutableIntCollection> R select(IntPredicate predicate, R target)
select(IntPredicate) , only the results are added to the target MutableIntCollection.default <R extends MutableIntCollection> R reject(IntPredicate predicate, R target)
reject(IntPredicate) , only the results are added to the target MutableIntCollection.<V> RichIterable<V> collect(IntToObjectFunction<? extends V> function)
default <V,R extends Collection<V>> R collect(IntToObjectFunction<? extends V> function, R target)
collect(IntToObjectFunction) , only the results are added to the target Collection.default <V,R extends Collection<V>> R flatCollect(IntToObjectFunction<? extends Iterable<V>> function, R target)
flatCollect is a special case of collect(IntToObjectFunction). With collect, when the IntToObjectFunction 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(IntToBooleanFunction 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(IntToByteFunction 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(IntToCharFunction 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(IntToShortFunction 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(IntToIntFunction 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(IntToFloatFunction 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(IntToLongFunction 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(IntToDoubleFunction function, R target)
MutableDoubleCollection with the results of applying the specified function on each element
of the source collection.int detectIfNone(IntPredicate predicate, int ifNone)
int count(IntPredicate predicate)
boolean anySatisfy(IntPredicate predicate)
boolean allSatisfy(IntPredicate predicate)
default boolean noneSatisfy(IntPredicate predicate)
MutableIntList toList()
MutableIntSet toSet()
MutableIntBag toBag()
LazyIntIterable asLazy()
<T> T injectInto(T injectedValue,
ObjectIntToObjectFunction<? super T,? extends T> function)
default boolean injectIntoBoolean(boolean injectedValue,
BooleanIntToBooleanFunction function)
default byte injectIntoByte(byte injectedValue,
ByteIntToByteFunction function)
default char injectIntoChar(char injectedValue,
CharIntToCharFunction function)
default short injectIntoShort(short injectedValue,
ShortIntToShortFunction function)
default int injectIntoInt(int injectedValue,
IntIntToIntFunction function)
default float injectIntoFloat(float injectedValue,
FloatIntToFloatFunction function)
default long injectIntoLong(long injectedValue,
LongIntToLongFunction function)
default double injectIntoDouble(double injectedValue,
DoubleIntToDoubleFunction function)
default long reduceIfEmpty(LongIntToLongFunction accumulator, long defaultValue)
reduce(LongIntToLongFunction)default long reduce(LongIntToLongFunction accumulator)
RichIterable.reduce(BinaryOperator)default RichIterable<IntIterable> chunk(int size)
size - the number of elements per chunkRichIterable containing IntIterables of size size, except the last will be
truncated if the elements don't divide evenly.long sum()
default IntSummaryStatistics summaryStatistics()
int max()
int maxIfEmpty(int defaultValue)
int min()
int minIfEmpty(int defaultValue)
double average()
default double averageIfEmpty(double defaultValue)
double median()
default double medianIfEmpty(double defaultValue)
int[] toSortedArray()
MutableIntList toSortedList()
default MutableIntList toSortedList(IntComparator comparator)
default <T> MutableIntList toSortedListBy(IntToObjectFunction<T> function)
function.default <T> MutableIntList toSortedListBy(IntToObjectFunction<T> function, Comparator<? super T> comparator)
function using the provided comparator.Copyright © 2004–2023. All rights reserved.