public interface ShortIterable extends PrimitiveIterable
| Modifier and Type | Method and Description |
|---|---|
boolean |
allSatisfy(ShortPredicate predicate)
Returns true if all of the elements in the ShortIterable return true for the
specified predicate, otherwise returns false.
|
boolean |
anySatisfy(ShortPredicate predicate)
Returns true if any of the elements in the ShortIterable return true for the
specified predicate, otherwise returns false.
|
LazyShortIterable |
asLazy()
Returns a LazyShortIterable adapter wrapping the source ShortIterable.
|
double |
average() |
default double |
averageIfEmpty(double defaultValue) |
default RichIterable<ShortIterable> |
chunk(int size)
Partitions elements in fixed size chunks.
|
<V> RichIterable<V> |
collect(ShortToObjectFunction<? 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(ShortToObjectFunction<? extends V> function,
R target)
Same as
collect(ShortToObjectFunction) , only the results are added to the target Collection. |
default <R extends MutableBooleanCollection> |
collectBoolean(ShortToBooleanFunction 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(ShortToByteFunction 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(ShortToCharFunction 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(ShortToDoubleFunction 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(ShortToFloatFunction 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(ShortToIntFunction 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(ShortToLongFunction 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(ShortToShortFunction function,
R target)
Returns the target
MutableShortCollection with the results of applying the specified function on each element
of the source collection. |
boolean |
contains(short value)
Returns true if the value is contained in the ShortIterable, and false if it is not.
|
default boolean |
containsAll(short... source)
Returns true if all of the values specified in the source array are contained
in the ShortIterable, and false if they are not.
|
default boolean |
containsAll(ShortIterable source)
Returns true if all of the values specified in the source ShortIterable are contained
in the ShortIterable, and false if they are not.
|
default boolean |
containsAny(short... source)
Returns true if any of the values specified in the source array are contained
in the ShortIterable, and false if they are not.
|
default boolean |
containsAny(ShortIterable source)
Returns true if any of the values specified in the source ShortIterable are contained
in the ShortIterable, and false if they are not.
|
default boolean |
containsNone(short... source)
Returns true if none of the values specified in the source array are contained
in the ShortIterable, and false if they are.
|
default boolean |
containsNone(ShortIterable source)
Returns true if none of the values specified in the source ShortIterable are contained
in the ShortIterable, and false if they are.
|
int |
count(ShortPredicate predicate)
Returns a count of the number of elements in the ShortIterable that return true for the
specified predicate.
|
short |
detectIfNone(ShortPredicate predicate,
short ifNone) |
void |
each(ShortProcedure procedure)
A synonym for forEach.
|
default <V,R extends Collection<V>> |
flatCollect(ShortToObjectFunction<? extends Iterable<V>> function,
R target)
flatCollect is a special case of collect(ShortToObjectFunction). |
default void |
forEach(ShortProcedure procedure)
Applies the ShortProcedure to each element in the ShortIterable.
|
<T> T |
injectInto(T injectedValue,
ObjectShortToObjectFunction<? super T,? extends T> function) |
default boolean |
injectIntoBoolean(boolean injectedValue,
BooleanShortToBooleanFunction 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,
ByteShortToByteFunction 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,
CharShortToCharFunction 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,
DoubleShortToDoubleFunction 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,
FloatShortToFloatFunction 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,
IntShortToIntFunction 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,
LongShortToLongFunction 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,
ShortShortToShortFunction function)
Returns the final short result of evaluating function using each element of the iterable and the previous evaluation
result as the parameters.
|
short |
max() |
short |
maxIfEmpty(short defaultValue) |
double |
median() |
default double |
medianIfEmpty(double defaultValue) |
short |
min() |
short |
minIfEmpty(short defaultValue) |
default boolean |
noneSatisfy(ShortPredicate predicate)
Returns true if none of the elements in the ShortIterable return true for the
specified predicate, otherwise returns false.
|
default long |
reduce(LongShortToLongFunction accumulator) |
default long |
reduceIfEmpty(LongShortToLongFunction accumulator,
long defaultValue) |
ShortIterable |
reject(ShortPredicate predicate)
Returns a new ShortIterable with all of the elements in the ShortIterable that
return false for the specified predicate.
|
default <R extends MutableShortCollection> |
reject(ShortPredicate predicate,
R target)
Same as
reject(ShortPredicate) , only the results are added to the target MutableShortCollection. |
ShortIterable |
select(ShortPredicate predicate)
Returns a new ShortIterable with all of the elements in the ShortIterable that
return true for the specified predicate.
|
default <R extends MutableShortCollection> |
select(ShortPredicate predicate,
R target)
Same as
select(ShortPredicate) , only the results are added to the target MutableShortCollection. |
ShortIterator |
shortIterator()
Returns a primitive iterator that can be used to iterate over the ShortIterable in an
imperative style.
|
long |
sum() |
default IntSummaryStatistics |
summaryStatistics() |
default ShortIterable |
tap(ShortProcedure procedure) |
short[] |
toArray()
Converts the ShortIterable to a primitive short array.
|
default short[] |
toArray(short[] target)
Converts the ShortIterable to a primitive short array.
|
MutableShortBag |
toBag()
Converts the ShortIterable to a new MutableShortBag.
|
MutableShortList |
toList()
Converts the ShortIterable to a new MutableShortList.
|
MutableShortSet |
toSet()
Converts the ShortIterable to a new MutableShortSet.
|
short[] |
toSortedArray() |
MutableShortList |
toSortedList() |
default MutableShortList |
toSortedList(ShortComparator comparator)
Converts the collection to a MutableShortList implementation sorted using the provided comparator.
|
default <T> MutableShortList |
toSortedListBy(ShortToObjectFunction<T> function)
Converts the collection to a MutableShortListImplementation sorted based on the natural order of the key returned
by
function. |
default <T> MutableShortList |
toSortedListBy(ShortToObjectFunction<T> function,
Comparator<? super T> comparator)
Converts the collection to a MutableShortList implementation, which is sorted based on the key returned by
function using the provided comparator. |
appendString, appendString, appendString, isEmpty, makeString, makeString, makeString, notEmpty, size, toStringShortIterator shortIterator()
short[] toArray()
default short[] toArray(short[] target)
boolean contains(short value)
default boolean containsAll(short... source)
default boolean containsAll(ShortIterable source)
default boolean containsAny(short... source)
default boolean containsAny(ShortIterable source)
default boolean containsNone(short... source)
default boolean containsNone(ShortIterable source)
default void forEach(ShortProcedure procedure)
void each(ShortProcedure procedure)
default ShortIterable tap(ShortProcedure procedure)
ShortIterable select(ShortPredicate predicate)
ShortIterable reject(ShortPredicate predicate)
default <R extends MutableShortCollection> R select(ShortPredicate predicate, R target)
select(ShortPredicate) , only the results are added to the target MutableShortCollection.default <R extends MutableShortCollection> R reject(ShortPredicate predicate, R target)
reject(ShortPredicate) , only the results are added to the target MutableShortCollection.<V> RichIterable<V> collect(ShortToObjectFunction<? extends V> function)
default <V,R extends Collection<V>> R collect(ShortToObjectFunction<? extends V> function, R target)
collect(ShortToObjectFunction) , only the results are added to the target Collection.default <V,R extends Collection<V>> R flatCollect(ShortToObjectFunction<? extends Iterable<V>> function, R target)
flatCollect is a special case of collect(ShortToObjectFunction). With collect, when the ShortToObjectFunction 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(ShortToBooleanFunction 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(ShortToByteFunction 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(ShortToCharFunction 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(ShortToShortFunction 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(ShortToIntFunction 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(ShortToFloatFunction 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(ShortToLongFunction 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(ShortToDoubleFunction function, R target)
MutableDoubleCollection with the results of applying the specified function on each element
of the source collection.short detectIfNone(ShortPredicate predicate, short ifNone)
int count(ShortPredicate predicate)
boolean anySatisfy(ShortPredicate predicate)
boolean allSatisfy(ShortPredicate predicate)
default boolean noneSatisfy(ShortPredicate predicate)
MutableShortList toList()
MutableShortSet toSet()
MutableShortBag toBag()
LazyShortIterable asLazy()
<T> T injectInto(T injectedValue,
ObjectShortToObjectFunction<? super T,? extends T> function)
default boolean injectIntoBoolean(boolean injectedValue,
BooleanShortToBooleanFunction function)
default byte injectIntoByte(byte injectedValue,
ByteShortToByteFunction function)
default char injectIntoChar(char injectedValue,
CharShortToCharFunction function)
default short injectIntoShort(short injectedValue,
ShortShortToShortFunction function)
default int injectIntoInt(int injectedValue,
IntShortToIntFunction function)
default float injectIntoFloat(float injectedValue,
FloatShortToFloatFunction function)
default long injectIntoLong(long injectedValue,
LongShortToLongFunction function)
default double injectIntoDouble(double injectedValue,
DoubleShortToDoubleFunction function)
default long reduceIfEmpty(LongShortToLongFunction accumulator, long defaultValue)
reduce(LongShortToLongFunction)default long reduce(LongShortToLongFunction accumulator)
RichIterable.reduce(BinaryOperator)default RichIterable<ShortIterable> chunk(int size)
size - the number of elements per chunkRichIterable containing ShortIterables of size size, except the last will be
truncated if the elements don't divide evenly.long sum()
default IntSummaryStatistics summaryStatistics()
short max()
short maxIfEmpty(short defaultValue)
short min()
short minIfEmpty(short defaultValue)
double average()
default double averageIfEmpty(double defaultValue)
double median()
default double medianIfEmpty(double defaultValue)
short[] toSortedArray()
MutableShortList toSortedList()
default MutableShortList toSortedList(ShortComparator comparator)
default <T> MutableShortList toSortedListBy(ShortToObjectFunction<T> function)
function.default <T> MutableShortList toSortedListBy(ShortToObjectFunction<T> function, Comparator<? super T> comparator)
function using the provided comparator.Copyright © 2004–2023. All rights reserved.