public interface CharIterable extends PrimitiveIterable
| Modifier and Type | Method and Description |
|---|---|
boolean |
allSatisfy(CharPredicate predicate)
Returns true if all of the elements in the CharIterable return true for the
specified predicate, otherwise returns false.
|
boolean |
anySatisfy(CharPredicate predicate)
Returns true if any of the elements in the CharIterable return true for the
specified predicate, otherwise returns false.
|
LazyCharIterable |
asLazy()
Returns a LazyCharIterable adapter wrapping the source CharIterable.
|
double |
average() |
default double |
averageIfEmpty(double defaultValue) |
CharIterator |
charIterator()
Returns a primitive iterator that can be used to iterate over the CharIterable in an
imperative style.
|
default RichIterable<CharIterable> |
chunk(int size)
Partitions elements in fixed size chunks.
|
<V> RichIterable<V> |
collect(CharToObjectFunction<? 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(CharToObjectFunction<? extends V> function,
R target)
Same as
collect(CharToObjectFunction) , only the results are added to the target Collection. |
default <R extends MutableBooleanCollection> |
collectBoolean(CharToBooleanFunction 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(CharToByteFunction 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(CharToCharFunction 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(CharToDoubleFunction 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(CharToFloatFunction 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(CharToIntFunction 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(CharToLongFunction 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(CharToShortFunction function,
R target)
Returns the target
MutableShortCollection with the results of applying the specified function on each element
of the source collection. |
boolean |
contains(char value)
Returns true if the value is contained in the CharIterable, and false if it is not.
|
default boolean |
containsAll(char... source)
Returns true if all of the values specified in the source array are contained
in the CharIterable, and false if they are not.
|
default boolean |
containsAll(CharIterable source)
Returns true if all of the values specified in the source CharIterable are contained
in the CharIterable, and false if they are not.
|
default boolean |
containsAny(char... source)
Returns true if any of the values specified in the source array are contained
in the CharIterable, and false if they are not.
|
default boolean |
containsAny(CharIterable source)
Returns true if any of the values specified in the source CharIterable are contained
in the CharIterable, and false if they are not.
|
default boolean |
containsNone(char... source)
Returns true if none of the values specified in the source array are contained
in the CharIterable, and false if they are.
|
default boolean |
containsNone(CharIterable source)
Returns true if none of the values specified in the source CharIterable are contained
in the CharIterable, and false if they are.
|
int |
count(CharPredicate predicate)
Returns a count of the number of elements in the CharIterable that return true for the
specified predicate.
|
char |
detectIfNone(CharPredicate predicate,
char ifNone) |
void |
each(CharProcedure procedure)
A synonym for forEach.
|
default <V,R extends Collection<V>> |
flatCollect(CharToObjectFunction<? extends Iterable<V>> function,
R target)
flatCollect is a special case of collect(CharToObjectFunction). |
default void |
forEach(CharProcedure procedure)
Applies the CharProcedure to each element in the CharIterable.
|
<T> T |
injectInto(T injectedValue,
ObjectCharToObjectFunction<? super T,? extends T> function) |
default boolean |
injectIntoBoolean(boolean injectedValue,
BooleanCharToBooleanFunction 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,
ByteCharToByteFunction 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,
CharCharToCharFunction 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,
DoubleCharToDoubleFunction 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,
FloatCharToFloatFunction 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,
IntCharToIntFunction 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,
LongCharToLongFunction 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,
ShortCharToShortFunction function)
Returns the final short result of evaluating function using each element of the iterable and the previous evaluation
result as the parameters.
|
char |
max() |
char |
maxIfEmpty(char defaultValue) |
double |
median() |
default double |
medianIfEmpty(double defaultValue) |
char |
min() |
char |
minIfEmpty(char defaultValue) |
default boolean |
noneSatisfy(CharPredicate predicate)
Returns true if none of the elements in the CharIterable return true for the
specified predicate, otherwise returns false.
|
default long |
reduce(LongCharToLongFunction accumulator) |
default long |
reduceIfEmpty(LongCharToLongFunction accumulator,
long defaultValue) |
CharIterable |
reject(CharPredicate predicate)
Returns a new CharIterable with all of the elements in the CharIterable that
return false for the specified predicate.
|
default <R extends MutableCharCollection> |
reject(CharPredicate predicate,
R target)
Same as
reject(CharPredicate) , only the results are added to the target MutableCharCollection. |
CharIterable |
select(CharPredicate predicate)
Returns a new CharIterable with all of the elements in the CharIterable that
return true for the specified predicate.
|
default <R extends MutableCharCollection> |
select(CharPredicate predicate,
R target)
Same as
select(CharPredicate) , only the results are added to the target MutableCharCollection. |
long |
sum() |
default IntSummaryStatistics |
summaryStatistics() |
default CharIterable |
tap(CharProcedure procedure) |
char[] |
toArray()
Converts the CharIterable to a primitive char array.
|
default char[] |
toArray(char[] target)
Converts the CharIterable to a primitive char array.
|
MutableCharBag |
toBag()
Converts the CharIterable to a new MutableCharBag.
|
MutableCharList |
toList()
Converts the CharIterable to a new MutableCharList.
|
MutableCharSet |
toSet()
Converts the CharIterable to a new MutableCharSet.
|
char[] |
toSortedArray() |
MutableCharList |
toSortedList() |
default MutableCharList |
toSortedList(CharComparator comparator)
Converts the collection to a MutableCharList implementation sorted using the provided comparator.
|
default <T> MutableCharList |
toSortedListBy(CharToObjectFunction<T> function)
Converts the collection to a MutableCharListImplementation sorted based on the natural order of the key returned
by
function. |
default <T> MutableCharList |
toSortedListBy(CharToObjectFunction<T> function,
Comparator<? super T> comparator)
Converts the collection to a MutableCharList implementation, which is sorted based on the key returned by
function using the provided comparator. |
appendString, appendString, appendString, isEmpty, makeString, makeString, makeString, notEmpty, size, toStringCharIterator charIterator()
char[] toArray()
default char[] toArray(char[] target)
boolean contains(char value)
default boolean containsAll(char... source)
default boolean containsAll(CharIterable source)
default boolean containsAny(char... source)
default boolean containsAny(CharIterable source)
default boolean containsNone(char... source)
default boolean containsNone(CharIterable source)
default void forEach(CharProcedure procedure)
void each(CharProcedure procedure)
default CharIterable tap(CharProcedure procedure)
CharIterable select(CharPredicate predicate)
CharIterable reject(CharPredicate predicate)
default <R extends MutableCharCollection> R select(CharPredicate predicate, R target)
select(CharPredicate) , only the results are added to the target MutableCharCollection.default <R extends MutableCharCollection> R reject(CharPredicate predicate, R target)
reject(CharPredicate) , only the results are added to the target MutableCharCollection.<V> RichIterable<V> collect(CharToObjectFunction<? extends V> function)
default <V,R extends Collection<V>> R collect(CharToObjectFunction<? extends V> function, R target)
collect(CharToObjectFunction) , only the results are added to the target Collection.default <V,R extends Collection<V>> R flatCollect(CharToObjectFunction<? extends Iterable<V>> function, R target)
flatCollect is a special case of collect(CharToObjectFunction). With collect, when the CharToObjectFunction 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(CharToBooleanFunction 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(CharToByteFunction 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(CharToCharFunction 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(CharToShortFunction 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(CharToIntFunction 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(CharToFloatFunction 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(CharToLongFunction 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(CharToDoubleFunction function, R target)
MutableDoubleCollection with the results of applying the specified function on each element
of the source collection.char detectIfNone(CharPredicate predicate, char ifNone)
int count(CharPredicate predicate)
boolean anySatisfy(CharPredicate predicate)
boolean allSatisfy(CharPredicate predicate)
default boolean noneSatisfy(CharPredicate predicate)
MutableCharList toList()
MutableCharSet toSet()
MutableCharBag toBag()
LazyCharIterable asLazy()
<T> T injectInto(T injectedValue,
ObjectCharToObjectFunction<? super T,? extends T> function)
default boolean injectIntoBoolean(boolean injectedValue,
BooleanCharToBooleanFunction function)
default byte injectIntoByte(byte injectedValue,
ByteCharToByteFunction function)
default char injectIntoChar(char injectedValue,
CharCharToCharFunction function)
default short injectIntoShort(short injectedValue,
ShortCharToShortFunction function)
default int injectIntoInt(int injectedValue,
IntCharToIntFunction function)
default float injectIntoFloat(float injectedValue,
FloatCharToFloatFunction function)
default long injectIntoLong(long injectedValue,
LongCharToLongFunction function)
default double injectIntoDouble(double injectedValue,
DoubleCharToDoubleFunction function)
default long reduceIfEmpty(LongCharToLongFunction accumulator, long defaultValue)
reduce(LongCharToLongFunction)default long reduce(LongCharToLongFunction accumulator)
RichIterable.reduce(BinaryOperator)default RichIterable<CharIterable> chunk(int size)
size - the number of elements per chunkRichIterable containing CharIterables of size size, except the last will be
truncated if the elements don't divide evenly.long sum()
default IntSummaryStatistics summaryStatistics()
char max()
char maxIfEmpty(char defaultValue)
char min()
char minIfEmpty(char defaultValue)
double average()
default double averageIfEmpty(double defaultValue)
double median()
default double medianIfEmpty(double defaultValue)
char[] toSortedArray()
MutableCharList toSortedList()
default MutableCharList toSortedList(CharComparator comparator)
default <T> MutableCharList toSortedListBy(CharToObjectFunction<T> function)
function.default <T> MutableCharList toSortedListBy(CharToObjectFunction<T> function, Comparator<? super T> comparator)
function using the provided comparator.Copyright © 2004–2023. All rights reserved.