public interface ByteIterable extends PrimitiveIterable
| Modifier and Type | Method and Description |
|---|---|
boolean |
allSatisfy(BytePredicate predicate)
Returns true if all of the elements in the ByteIterable return true for the
specified predicate, otherwise returns false.
|
boolean |
anySatisfy(BytePredicate predicate)
Returns true if any of the elements in the ByteIterable return true for the
specified predicate, otherwise returns false.
|
LazyByteIterable |
asLazy()
Returns a LazyByteIterable adapter wrapping the source ByteIterable.
|
double |
average() |
default double |
averageIfEmpty(double defaultValue) |
ByteIterator |
byteIterator()
Returns a primitive iterator that can be used to iterate over the ByteIterable in an
imperative style.
|
default RichIterable<ByteIterable> |
chunk(int size)
Partitions elements in fixed size chunks.
|
<V> RichIterable<V> |
collect(ByteToObjectFunction<? 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(ByteToObjectFunction<? extends V> function,
R target)
Same as
collect(ByteToObjectFunction) , only the results are added to the target Collection. |
default <R extends MutableBooleanCollection> |
collectBoolean(ByteToBooleanFunction 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(ByteToByteFunction 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(ByteToCharFunction 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(ByteToDoubleFunction 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(ByteToFloatFunction 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(ByteToIntFunction 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(ByteToLongFunction 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(ByteToShortFunction function,
R target)
Returns the target
MutableShortCollection with the results of applying the specified function on each element
of the source collection. |
boolean |
contains(byte value)
Returns true if the value is contained in the ByteIterable, and false if it is not.
|
default boolean |
containsAll(byte... source)
Returns true if all of the values specified in the source array are contained
in the ByteIterable, and false if they are not.
|
default boolean |
containsAll(ByteIterable source)
Returns true if all of the values specified in the source ByteIterable are contained
in the ByteIterable, and false if they are not.
|
default boolean |
containsAny(byte... source)
Returns true if any of the values specified in the source array are contained
in the ByteIterable, and false if they are not.
|
default boolean |
containsAny(ByteIterable source)
Returns true if any of the values specified in the source ByteIterable are contained
in the ByteIterable, and false if they are not.
|
default boolean |
containsNone(byte... source)
Returns true if none of the values specified in the source array are contained
in the ByteIterable, and false if they are.
|
default boolean |
containsNone(ByteIterable source)
Returns true if none of the values specified in the source ByteIterable are contained
in the ByteIterable, and false if they are.
|
int |
count(BytePredicate predicate)
Returns a count of the number of elements in the ByteIterable that return true for the
specified predicate.
|
byte |
detectIfNone(BytePredicate predicate,
byte ifNone) |
void |
each(ByteProcedure procedure)
A synonym for forEach.
|
default <V,R extends Collection<V>> |
flatCollect(ByteToObjectFunction<? extends Iterable<V>> function,
R target)
flatCollect is a special case of collect(ByteToObjectFunction). |
void |
forEach(ByteProcedure procedure)
Applies the ByteProcedure to each element in the ByteIterable.
|
<T> T |
injectInto(T injectedValue,
ObjectByteToObjectFunction<? super T,? extends T> function) |
byte |
max() |
byte |
maxIfEmpty(byte defaultValue) |
double |
median() |
default double |
medianIfEmpty(double defaultValue) |
byte |
min() |
byte |
minIfEmpty(byte defaultValue) |
boolean |
noneSatisfy(BytePredicate predicate)
Returns true if none of the elements in the ByteIterable return true for the
specified predicate, otherwise returns false.
|
default long |
reduce(LongByteToLongFunction accumulator) |
default long |
reduceIfEmpty(LongByteToLongFunction accumulator,
long defaultValue) |
ByteIterable |
reject(BytePredicate predicate)
Returns a new ByteIterable with all of the elements in the ByteIterable that
return false for the specified predicate.
|
default <R extends MutableByteCollection> |
reject(BytePredicate predicate,
R target)
Same as
reject(BytePredicate) , only the results are added to the target MutableByteCollection. |
ByteIterable |
select(BytePredicate predicate)
Returns a new ByteIterable with all of the elements in the ByteIterable that
return true for the specified predicate.
|
default <R extends MutableByteCollection> |
select(BytePredicate predicate,
R target)
Same as
select(BytePredicate) , only the results are added to the target MutableByteCollection. |
long |
sum() |
default IntSummaryStatistics |
summaryStatistics() |
default ByteIterable |
tap(ByteProcedure procedure) |
byte[] |
toArray()
Converts the ByteIterable to a primitive byte array.
|
default byte[] |
toArray(byte[] target)
Converts the ByteIterable to a primitive byte array.
|
MutableByteBag |
toBag()
Converts the ByteIterable to a new MutableByteBag.
|
MutableByteList |
toList()
Converts the ByteIterable to a new MutableByteList.
|
MutableByteSet |
toSet()
Converts the ByteIterable to a new MutableByteSet.
|
byte[] |
toSortedArray() |
MutableByteList |
toSortedList() |
default MutableByteList |
toSortedList(ByteComparator comparator)
Converts the collection to a MutableByteList implementation sorted using the provided comparator.
|
default <T> MutableByteList |
toSortedListBy(ByteToObjectFunction<T> function)
Converts the collection to a MutableByteListImplementation sorted based on the natural order of the key returned
by
function. |
default <T> MutableByteList |
toSortedListBy(ByteToObjectFunction<T> function,
Comparator<? super T> comparator)
Converts the collection to a MutableByteList implementation, which is sorted based on the key returned by
function using the provided comparator. |
appendString, appendString, appendString, isEmpty, makeString, makeString, makeString, notEmpty, size, toStringByteIterator byteIterator()
byte[] toArray()
default byte[] toArray(byte[] target)
boolean contains(byte value)
default boolean containsAll(byte... source)
default boolean containsAll(ByteIterable source)
default boolean containsAny(byte... source)
default boolean containsAny(ByteIterable source)
default boolean containsNone(byte... source)
default boolean containsNone(ByteIterable source)
void forEach(ByteProcedure procedure)
void each(ByteProcedure procedure)
default ByteIterable tap(ByteProcedure procedure)
ByteIterable select(BytePredicate predicate)
ByteIterable reject(BytePredicate predicate)
default <R extends MutableByteCollection> R select(BytePredicate predicate, R target)
select(BytePredicate) , only the results are added to the target MutableByteCollection.default <R extends MutableByteCollection> R reject(BytePredicate predicate, R target)
reject(BytePredicate) , only the results are added to the target MutableByteCollection.<V> RichIterable<V> collect(ByteToObjectFunction<? extends V> function)
default <V,R extends Collection<V>> R collect(ByteToObjectFunction<? extends V> function, R target)
collect(ByteToObjectFunction) , only the results are added to the target Collection.default <V,R extends Collection<V>> R flatCollect(ByteToObjectFunction<? extends Iterable<V>> function, R target)
flatCollect is a special case of collect(ByteToObjectFunction). With collect, when the ByteToObjectFunction 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(ByteToBooleanFunction 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(ByteToByteFunction 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(ByteToCharFunction 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(ByteToShortFunction 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(ByteToIntFunction 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(ByteToFloatFunction 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(ByteToLongFunction 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(ByteToDoubleFunction function, R target)
MutableDoubleCollection with the results of applying the specified function on each element
of the source collection.byte detectIfNone(BytePredicate predicate, byte ifNone)
int count(BytePredicate predicate)
boolean anySatisfy(BytePredicate predicate)
boolean allSatisfy(BytePredicate predicate)
boolean noneSatisfy(BytePredicate predicate)
MutableByteList toList()
MutableByteSet toSet()
MutableByteBag toBag()
LazyByteIterable asLazy()
<T> T injectInto(T injectedValue,
ObjectByteToObjectFunction<? super T,? extends T> function)
default long reduceIfEmpty(LongByteToLongFunction accumulator, long defaultValue)
reduce(LongByteToLongFunction)default long reduce(LongByteToLongFunction accumulator)
RichIterable.reduce(BinaryOperator)default RichIterable<ByteIterable> chunk(int size)
size - the number of elements per chunkRichIterable containing ByteIterables of size size, except the last will be
truncated if the elements don't divide evenly.long sum()
default IntSummaryStatistics summaryStatistics()
byte max()
byte maxIfEmpty(byte defaultValue)
byte min()
byte minIfEmpty(byte defaultValue)
double average()
default double averageIfEmpty(double defaultValue)
double median()
default double medianIfEmpty(double defaultValue)
byte[] toSortedArray()
MutableByteList toSortedList()
default MutableByteList toSortedList(ByteComparator comparator)
default <T> MutableByteList toSortedListBy(ByteToObjectFunction<T> function)
function.default <T> MutableByteList toSortedListBy(ByteToObjectFunction<T> function, Comparator<? super T> comparator)
function using the provided comparator.Copyright © 2004–2021. All rights reserved.