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() |
<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.
|
boolean |
containsAll(int... source)
Returns true if the all of the values specified in the source array are contained
in the IntIterable, and false if they are not.
|
boolean |
containsAll(IntIterable source)
Returns true if the all of the values specified in the source IntIterable are contained
in the IntIterable, and false if they are not.
|
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) . |
void |
forEach(IntProcedure procedure)
Applies the IntProcedure to each element in the IntIterable.
|
<T> T |
injectInto(T injectedValue,
ObjectIntToObjectFunction<? super T,? extends T> function) |
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() |
int |
min() |
int |
minIfEmpty(int defaultValue) |
boolean |
noneSatisfy(IntPredicate predicate)
Returns true if none of the elements in the IntIterable return true for the
specified predicate, otherwise returns false.
|
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() |
int[] |
toArray()
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() |
appendString, appendString, appendString, isEmpty, makeString, makeString, makeString, notEmpty, size, toString
IntIterator intIterator()
int[] toArray()
boolean contains(int value)
boolean containsAll(int... source)
boolean containsAll(IntIterable source)
void forEach(IntProcedure procedure)
void each(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)
boolean noneSatisfy(IntPredicate predicate)
MutableIntList toList()
MutableIntSet toSet()
MutableIntBag toBag()
LazyIntIterable asLazy()
<T> T injectInto(T injectedValue, ObjectIntToObjectFunction<? super T,? extends T> function)
long sum()
default IntSummaryStatistics summaryStatistics()
int max()
int maxIfEmpty(int defaultValue)
int min()
int minIfEmpty(int defaultValue)
double average()
double median()
int[] toSortedArray()
MutableIntList toSortedList()
Copyright © 2004–2017. All rights reserved.