public abstract class CharStream
extends java.lang.Object
Stream
BaseStream.Splitor
Modifier and Type | Method and Description |
---|---|
<R> R |
__(Function<? super CharStream,R> transfer) |
abstract <E extends java.lang.Exception> |
allMatch(Try.CharPredicate<E> predicate) |
abstract <E extends java.lang.Exception> |
anyMatch(Try.CharPredicate<E> predicate) |
abstract IntStream |
asIntStream()
Returns a
LongStream consisting of the elements of this stream,
converted to long . |
abstract u.OptionalDouble |
average() |
abstract Stream<java.lang.Character> |
boxed()
Returns a
Stream consisting of the elements of this stream,
each boxed to an Chareger . |
S |
carry(C action)
Same as
peek |
void |
close() |
abstract Stream<CharList> |
collapse(CharBiPredicate collapsible)
Merge series of adjacent elements which satisfy the given predicate using
the merger function and return a new stream.
|
abstract CharStream |
collapse(CharBiPredicate collapsible,
CharBinaryOperator mergeFunction)
Merge series of adjacent elements which satisfy the given predicate using
the merger function and return a new stream.
|
abstract <R> R |
collect(Supplier<R> supplier,
ObjCharConsumer<? super R> accumulator) |
abstract <R> R |
collect(Supplier<R> supplier,
ObjCharConsumer<? super R> accumulator,
BiConsumer<R,R> combiner)
Performs a mutable
reduction operation on the elements of this stream.
|
static CharStream |
concat(char[]... a) |
static CharStream |
concat(CharIterator... a) |
static CharStream |
concat(CharStream... a) |
static CharStream |
concat(java.util.Collection<? extends CharStream> c) |
static CharStream |
empty() |
abstract <E extends java.lang.Exception> |
findAny(Try.CharPredicate<E> predicate) |
abstract <E extends java.lang.Exception> |
findFirst(Try.CharPredicate<E> predicate) |
abstract <E extends java.lang.Exception,E2 extends java.lang.Exception> |
findFirstOrLast(Try.CharPredicate<E> predicateForFirst,
Try.CharPredicate<E> predicateForLast) |
abstract <E extends java.lang.Exception> |
findLast(Try.CharPredicate<E> predicate) |
static CharStream |
flat(char[][] a) |
static CharStream |
flat(char[][][] a) |
static CharStream |
flat(char[][] a,
boolean vertically) |
static CharStream |
flat(char[][] a,
char valueForNone,
boolean vertically) |
abstract CharStream |
flatMap(CharFunction<? extends CharStream> mapper)
Returns a stream consisting of the results of replacing each element of
this stream with the contents of a mapped stream produced by applying
the provided mapping function to each element.
|
abstract <T> Stream<T> |
flatMappToObj(CharFunction<T[]> mapper) |
abstract IntStream |
flatMapToInt(CharFunction<? extends IntStream> mapper) |
abstract <T> Stream<T> |
flatMapToObj(CharFunction<? extends Stream<T>> mapper) |
abstract CharStream |
flattMap(CharFunction<char[]> mapper) |
abstract <T> Stream<T> |
flattMapToObj(CharFunction<? extends java.util.Collection<T>> mapper) |
abstract <E extends java.lang.Exception> |
forEach(Try.CharConsumer<E> action) |
static CharStream |
generate(CharSupplier s) |
boolean |
isParallel() |
static CharStream |
iterate(BooleanSupplier hasNext,
CharSupplier next) |
static CharStream |
iterate(char init,
BooleanSupplier hasNext,
CharUnaryOperator f) |
static CharStream |
iterate(char init,
CharPredicate hasNext,
CharUnaryOperator f) |
static CharStream |
iterate(char init,
CharUnaryOperator f) |
CharIterator |
iterator()
Remember to close this Stream after the iteration is done, if required.
|
java.lang.String |
join(java.lang.CharSequence delimiter) |
abstract u.OptionalChar |
kthLargest(int k) |
abstract CharStream |
map(CharUnaryOperator mapper)
Returns a stream consisting of the results of applying the given
function to the elements of this stream.
|
abstract IntStream |
mapToInt(CharToIntFunction mapper)
Returns a
IntStream consisting of the results of applying the
given function to the elements of this stream. |
abstract <U> Stream<U> |
mapToObj(CharFunction<? extends U> mapper)
Returns an object-valued
Stream consisting of the results of
applying the given function to the elements of this stream. |
abstract u.OptionalChar |
max()
Returns an
OptionalChar describing the maximum element of this
stream, or an empty optional if this stream is empty. |
static CharStream |
merge(char[] a,
char[] b,
char[] c,
CharBiFunction<com.landawn.abacus.util.Nth> nextSelector) |
static CharStream |
merge(char[] a,
char[] b,
CharBiFunction<com.landawn.abacus.util.Nth> nextSelector) |
static CharStream |
merge(CharIterator a,
CharIterator b,
CharBiFunction<com.landawn.abacus.util.Nth> nextSelector) |
static CharStream |
merge(CharIterator a,
CharIterator b,
CharIterator c,
CharBiFunction<com.landawn.abacus.util.Nth> nextSelector) |
abstract CharStream |
merge(CharStream b,
CharBiFunction<com.landawn.abacus.util.Nth> nextSelector) |
static CharStream |
merge(CharStream a,
CharStream b,
CharBiFunction<com.landawn.abacus.util.Nth> nextSelector) |
static CharStream |
merge(CharStream a,
CharStream b,
CharStream c,
CharBiFunction<com.landawn.abacus.util.Nth> nextSelector) |
static CharStream |
merge(java.util.Collection<? extends CharStream> c,
CharBiFunction<com.landawn.abacus.util.Nth> nextSelector) |
abstract u.OptionalChar |
min()
Returns an
OptionalChar describing the minimum element of this
stream, or an empty optional if this stream is empty. |
abstract <E extends java.lang.Exception> |
noneMatch(Try.CharPredicate<E> predicate) |
static CharStream |
of(char... a) |
static CharStream |
of(char[] a,
int startIndex,
int endIndex) |
static CharStream |
of(java.lang.Character[] a) |
static CharStream |
of(java.lang.Character[] a,
int startIndex,
int endIndex) |
static CharStream |
of(CharIterator iterator) |
static CharStream |
of(java.lang.CharSequence str)
Takes the chars in the specified String as the elements of the Stream
|
static CharStream |
of(java.lang.CharSequence str,
int startIndex,
int endIndex)
Takes the chars in the specified String as the elements of the Stream
|
static CharStream |
of(java.util.Collection<java.lang.Character> c) |
static CharStream |
of(Supplier<CharList> supplier)
Lazy evaluation.
|
S |
parallel() |
S |
parallel(BaseStream.Splitor splitor) |
S |
parallel(java.util.concurrent.Executor exector) |
S |
parallel(int maxThreadNum) |
static CharStream |
parallelMerge(java.util.Collection<? extends CharStream> c,
CharBiFunction<com.landawn.abacus.util.Nth> nextSelector) |
static CharStream |
parallelMerge(java.util.Collection<? extends CharStream> c,
CharBiFunction<com.landawn.abacus.util.Nth> nextSelector,
int maxThreadNum) |
void |
println() |
static CharStream |
random() |
static CharStream |
random(char[] candicates) |
static CharStream |
random(char startInclusive,
char endExclusive) |
static CharStream |
range(char startInclusive,
char endExclusive) |
static CharStream |
range(char startInclusive,
char endExclusive,
int by) |
static CharStream |
rangeClosed(char startInclusive,
char endInclusive) |
static CharStream |
rangeClosed(char startInclusive,
char endInclusive,
int by) |
abstract CharStream |
rangeMap(CharBiPredicate sameRange,
CharBinaryOperator mapper)
Note: copied from StreamEx: https://github.com/amaembo/streamex
Returns a stream consisting of results of applying the given function to the ranges created from the source elements. |
abstract <T> Stream<T> |
rangeMapp(CharBiPredicate sameRange,
CharBiFunction<T> mapper)
Note: copied from StreamEx: https://github.com/amaembo/streamex
Returns a stream consisting of results of applying the given function to the ranges created from the source elements. |
abstract u.OptionalChar |
reduce(CharBinaryOperator op)
Performs a reduction on the
elements of this stream, using an
associative accumulation
function, and returns an
OptionalChar describing the reduced value,
if any. |
abstract char |
reduce(char identity,
CharBinaryOperator op)
Performs a reduction on the
elements of this stream, using the provided identity value and an
associative
accumulation function, and returns the reduced value.
|
static CharStream |
repeat(char element,
long n) |
abstract CharStream |
scan(CharBinaryOperator accumulator)
Returns a
Stream produced by iterative application of a accumulation function
to an initial element init and next element of the current stream. |
abstract CharStream |
scan(char init,
CharBinaryOperator accumulator)
Returns a
Stream produced by iterative application of a accumulation function
to an initial element init and next element of the current stream. |
abstract CharStream |
scan(char init,
CharBinaryOperator accumulator,
boolean initIncluded) |
S |
sequential() |
S |
shuffled()
This method only run sequentially, even in parallel stream and all elements will be loaded to memory. |
S |
slice(long from,
long to)
Same as:
stream.skip(from).limit(to - from) . |
Stream<S> |
sliding(int windowSize) |
Stream<PL> |
slidingToList(int windowSize) |
abstract int |
sum() |
abstract com.landawn.abacus.util.CharSummaryStatistics |
summarize() |
abstract Pair<com.landawn.abacus.util.CharSummaryStatistics,u.Optional<java.util.Map<com.landawn.abacus.util.Percentage,java.lang.Character>>> |
summarizeAndPercentiles() |
abstract CharList |
toCharList() |
ImmutableList<T> |
toImmutableList() |
ImmutableSet<T> |
toImmutableSet() |
abstract <K,V> java.util.Map<K,V> |
toMap(CharFunction<? extends K> keyMapper,
CharFunction<? extends V> valueMapper) |
abstract <K,V> java.util.Map<K,V> |
toMap(CharFunction<? extends K> keyMapper,
CharFunction<? extends V> valueMapper,
BinaryOperator<V> mergeFunction) |
abstract <K,V,M extends java.util.Map<K,V>> |
toMap(CharFunction<? extends K> keyMapper,
CharFunction<? extends V> valueMapper,
BinaryOperator<V> mergeFunction,
Supplier<? extends M> mapFactory) |
abstract <K,V,M extends java.util.Map<K,V>> |
toMap(CharFunction<? extends K> keyMapper,
CharFunction<? extends V> valueMapper,
Supplier<? extends M> mapFactory) |
abstract <K,A,D> java.util.Map<K,D> |
toMap(CharFunction<? extends K> keyMapper,
Collector<java.lang.Character,A,D> downstream) |
abstract <K,A,D,M extends java.util.Map<K,D>> |
toMap(CharFunction<? extends K> keyMapper,
Collector<java.lang.Character,A,D> downstream,
Supplier<? extends M> mapFactory) |
abstract CharMatrix |
toMatrix() |
static CharStream |
zip(char[] a,
char[] b,
char[] c,
char valueForNoneA,
char valueForNoneB,
char valueForNoneC,
CharTernaryOperator zipFunction)
Zip together the "a", "b" and "c" iterators until all of them runs out of values.
|
static CharStream |
zip(char[] a,
char[] b,
char[] c,
CharTernaryOperator zipFunction)
Zip together the "a", "b" and "c" arrays until one of them runs out of values.
|
static CharStream |
zip(char[] a,
char[] b,
CharBinaryOperator zipFunction)
Zip together the "a" and "b" arrays until one of them runs out of values.
|
static CharStream |
zip(char[] a,
char[] b,
char valueForNoneA,
char valueForNoneB,
CharBinaryOperator zipFunction)
Zip together the "a" and "b" iterators until all of them runs out of values.
|
static CharStream |
zip(CharIterator a,
CharIterator b,
CharBinaryOperator zipFunction)
Zip together the "a" and "b" iterators until one of them runs out of values.
|
static CharStream |
zip(CharIterator a,
CharIterator b,
char valueForNoneA,
char valueForNoneB,
CharBinaryOperator zipFunction)
Zip together the "a" and "b" iterators until all of them runs out of values.
|
static CharStream |
zip(CharIterator a,
CharIterator b,
CharIterator c,
char valueForNoneA,
char valueForNoneB,
char valueForNoneC,
CharTernaryOperator zipFunction)
Zip together the "a", "b" and "c" iterators until all of them runs out of values.
|
static CharStream |
zip(CharIterator a,
CharIterator b,
CharIterator c,
CharTernaryOperator zipFunction)
Zip together the "a", "b" and "c" iterators until one of them runs out of values.
|
static CharStream |
zip(CharStream a,
CharStream b,
CharBinaryOperator zipFunction)
Zip together the "a" and "b" streams until one of them runs out of values.
|
static CharStream |
zip(CharStream a,
CharStream b,
char valueForNoneA,
char valueForNoneB,
CharBinaryOperator zipFunction)
Zip together the "a" and "b" iterators until all of them runs out of values.
|
static CharStream |
zip(CharStream a,
CharStream b,
CharStream c,
char valueForNoneA,
char valueForNoneB,
char valueForNoneC,
CharTernaryOperator zipFunction)
Zip together the "a", "b" and "c" iterators until all of them runs out of values.
|
static CharStream |
zip(CharStream a,
CharStream b,
CharStream c,
CharTernaryOperator zipFunction)
Zip together the "a", "b" and "c" streams until one of them runs out of values.
|
static CharStream |
zip(java.util.Collection<? extends CharStream> c,
char[] valuesForNone,
CharNFunction<java.lang.Character> zipFunction)
Zip together the iterators until all of them runs out of values.
|
static CharStream |
zip(java.util.Collection<? extends CharStream> c,
CharNFunction<java.lang.Character> zipFunction)
Zip together the iterators until one of them runs out of values.
|
abstract CharStream |
zipWith(CharStream b,
CharBinaryOperator zipFunction) |
abstract CharStream |
zipWith(CharStream b,
char valueForNoneA,
char valueForNoneB,
CharBinaryOperator zipFunction) |
abstract CharStream |
zipWith(CharStream b,
CharStream c,
char valueForNoneA,
char valueForNoneB,
char valueForNoneC,
CharTernaryOperator zipFunction) |
abstract CharStream |
zipWith(CharStream b,
CharStream c,
CharTernaryOperator zipFunction) |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
append, appendIfEmpty, count, difference, distinct, dropWhile, dropWhile, filter, first, indexed, intersection, join, last, limit, onClose, onlyOne, parallel, parallel, peek, percentiles, prepend, removeIf, removeIf, reversed, reverseSorted, rotated, shuffled, skip, skip, sliding, slidingToList, sorted, split, split, splitAt, splitBy, splitToList, splitToList, step, symmetricDifference, takeWhile, toArray, toCollection, toList, toLongMultiset, toLongMultiset, toMultiset, toMultiset, toSet
public abstract CharStream map(CharUnaryOperator mapper)
This is an intermediate operation.
mapper
- a non-interfering,
stateless
function to apply to each elementpublic abstract IntStream mapToInt(CharToIntFunction mapper)
IntStream
consisting of the results of applying the
given function to the elements of this stream.
This is an intermediate operation.
mapper
- a non-interfering,
stateless
function to apply to each elementpublic abstract <U> Stream<U> mapToObj(CharFunction<? extends U> mapper)
Stream
consisting of the results of
applying the given function to the elements of this stream.
This is an intermediate operation.
U
- the element type of the new streammapper
- a non-interfering,
stateless
function to apply to each elementpublic abstract CharStream flatMap(CharFunction<? extends CharStream> mapper)
This is an intermediate operation.
mapper
- a non-interfering,
stateless
function to apply to each element which produces an
CharStream
of new valuesStream.flatMap(Function)
public abstract CharStream flattMap(CharFunction<char[]> mapper)
public abstract IntStream flatMapToInt(CharFunction<? extends IntStream> mapper)
public abstract <T> Stream<T> flatMapToObj(CharFunction<? extends Stream<T>> mapper)
public abstract <T> Stream<T> flattMapToObj(CharFunction<? extends java.util.Collection<T>> mapper)
public abstract <T> Stream<T> flatMappToObj(CharFunction<T[]> mapper)
@SequentialOnly public abstract CharStream rangeMap(CharBiPredicate sameRange, CharBinaryOperator mapper)
sameRange
- a non-interfering, stateless predicate to apply to
the leftmost and next elements which returns true for elements
which belong to the same range.mapper
- a non-interfering, stateless function to apply to the
range borders and produce the resulting element. If value was
not merged to the interval, then mapper will receive the same
value twice, otherwise it will receive the leftmost and the
rightmost values which were merged to the range.collapse(CharBiPredicate, CharBinaryOperator)
,
Stream.rangeMap(BiPredicate, BiFunction)
@SequentialOnly public abstract <T> Stream<T> rangeMapp(CharBiPredicate sameRange, CharBiFunction<T> mapper)
sameRange
- a non-interfering, stateless predicate to apply to
the leftmost and next elements which returns true for elements
which belong to the same range.mapper
- a non-interfering, stateless function to apply to the
range borders and produce the resulting element. If value was
not merged to the interval, then mapper will receive the same
value twice, otherwise it will receive the leftmost and the
rightmost values which were merged to the range.Stream.rangeMap(BiPredicate, BiFunction)
@SequentialOnly public abstract Stream<CharList> collapse(CharBiPredicate collapsible)
collapsible
- @SequentialOnly public abstract CharStream collapse(CharBiPredicate collapsible, CharBinaryOperator mergeFunction)
collapsible
- mergeFunction
- @SequentialOnly public abstract CharStream scan(CharBinaryOperator accumulator)
Stream
produced by iterative application of a accumulation function
to an initial element init
and next element of the current stream.
Produces a Stream
consisting of init
, acc(init, value1)
,
acc(acc(init, value1), value2)
, etc.
This is an intermediate operation.
Example:
accumulator: (a, b) -> a + b stream: [1, 2, 3, 4, 5] result: [1, 3, 6, 10, 15]
accumulator
- the accumulation function@SequentialOnly public abstract CharStream scan(char init, CharBinaryOperator accumulator)
Stream
produced by iterative application of a accumulation function
to an initial element init
and next element of the current stream.
Produces a Stream
consisting of init
, acc(init, value1)
,
acc(acc(init, value1), value2)
, etc.
This is an intermediate operation.
Example:
init:10 accumulator: (a, b) -> a + b stream: [1, 2, 3, 4, 5] result: [11, 13, 16, 20, 25]
init
- the initial value. it's only used once by accumulator
to calculate the fist element in the returned stream.
It will be ignored if this stream is empty and won't be the first element of the returned stream.accumulator
- the accumulation function@SequentialOnly public abstract CharStream scan(char init, CharBinaryOperator accumulator, boolean initIncluded)
init
- accumulator
- initIncluded
- public abstract CharList toCharList()
public abstract <K,V> java.util.Map<K,V> toMap(CharFunction<? extends K> keyMapper, CharFunction<? extends V> valueMapper)
keyMapper
- valueMapper
- Collectors.toMap(Function, Function)
public abstract <K,V,M extends java.util.Map<K,V>> M toMap(CharFunction<? extends K> keyMapper, CharFunction<? extends V> valueMapper, Supplier<? extends M> mapFactory)
keyMapper
- valueMapper
- mapFactory
- Collectors.toMap(Function, Function, Supplier)
public abstract <K,V> java.util.Map<K,V> toMap(CharFunction<? extends K> keyMapper, CharFunction<? extends V> valueMapper, BinaryOperator<V> mergeFunction)
keyMapper
- valueMapper
- mergeFunction
- Collectors.toMap(Function, Function, BinaryOperator)
public abstract <K,V,M extends java.util.Map<K,V>> M toMap(CharFunction<? extends K> keyMapper, CharFunction<? extends V> valueMapper, BinaryOperator<V> mergeFunction, Supplier<? extends M> mapFactory)
keyMapper
- valueMapper
- mergeFunction
- mapFactory
- Collectors.toMap(Function, Function, BinaryOperator, Supplier)
public abstract <K,A,D> java.util.Map<K,D> toMap(CharFunction<? extends K> keyMapper, Collector<java.lang.Character,A,D> downstream)
keyMapper
- downstream
- Collectors.groupingBy(Function, Collector)
public abstract <K,A,D,M extends java.util.Map<K,D>> M toMap(CharFunction<? extends K> keyMapper, Collector<java.lang.Character,A,D> downstream, Supplier<? extends M> mapFactory)
keyMapper
- downstream
- mapFactory
- Collectors.groupingBy(Function, Collector, Supplier)
public abstract CharMatrix toMatrix()
public abstract char reduce(char identity, CharBinaryOperator op)
int result = identity;
for (int element : this stream)
result = accumulator.applyAsChar(result, element)
return result;
but is not constrained to execute sequentially.
The identity
value must be an identity for the accumulator
function. This means that for all x
,
accumulator.apply(identity, x)
is equal to x
.
The accumulator
function must be an
associative function.
This is a terminal operation.
identity
- the identity value for the accumulating functionop
- an associative,
non-interfering,
stateless
function for combining two valuessum()
,
min()
,
max()
,
average()
public abstract u.OptionalChar reduce(CharBinaryOperator op)
OptionalChar
describing the reduced value,
if any. This is equivalent to:
boolean foundAny = false;
int result = null;
for (int element : this stream) {
if (!foundAny) {
foundAny = true;
result = element;
}
else
result = accumulator.applyAsChar(result, element);
}
return foundAny ? OptionalChar.of(result) : OptionalChar.empty();
but is not constrained to execute sequentially.
The accumulator
function must be an
associative function.
This is a terminal operation.
op
- an associative,
non-interfering,
stateless
function for combining two values#reduce(int, CharBinaryOperator)
public abstract <R> R collect(Supplier<R> supplier, ObjCharConsumer<? super R> accumulator, BiConsumer<R,R> combiner)
ArrayList
, and elements are incorporated by updating
the state of the result rather than by replacing the result. This
produces a result equivalent to:
R result = supplier.get();
for (int element : this stream)
accumulator.accept(result, element);
return result;
Like #reduce(int, CharBinaryOperator)
, collect
operations
can be parallelized without requiring additional synchronization.
This is a terminal operation.
R
- type of the resultsupplier
- a function that creates a new result container. For a
parallel execution, this function may be called
multiple times and must return a fresh value each time.accumulator
- an associative,
non-interfering,
stateless
function for incorporating an additional element into a resultcombiner
- an associative,
non-interfering,
stateless
function for combining two values, which must be
compatible with the accumulator functionStream.collect(Supplier, BiConsumer, BiConsumer)
public abstract <R> R collect(Supplier<R> supplier, ObjCharConsumer<? super R> accumulator)
supplier
- accumulator
- public abstract <E extends java.lang.Exception> void forEach(Try.CharConsumer<E> action) throws E extends java.lang.Exception
E extends java.lang.Exception
public abstract <E extends java.lang.Exception> boolean anyMatch(Try.CharPredicate<E> predicate) throws E extends java.lang.Exception
E extends java.lang.Exception
public abstract <E extends java.lang.Exception> boolean allMatch(Try.CharPredicate<E> predicate) throws E extends java.lang.Exception
E extends java.lang.Exception
public abstract <E extends java.lang.Exception> boolean noneMatch(Try.CharPredicate<E> predicate) throws E extends java.lang.Exception
E extends java.lang.Exception
public abstract <E extends java.lang.Exception> u.OptionalChar findFirst(Try.CharPredicate<E> predicate) throws E extends java.lang.Exception
E extends java.lang.Exception
public abstract <E extends java.lang.Exception> u.OptionalChar findLast(Try.CharPredicate<E> predicate) throws E extends java.lang.Exception
E extends java.lang.Exception
public abstract <E extends java.lang.Exception,E2 extends java.lang.Exception> u.OptionalChar findFirstOrLast(Try.CharPredicate<E> predicateForFirst, Try.CharPredicate<E> predicateForLast) throws E extends java.lang.Exception, E2 extends java.lang.Exception
E extends java.lang.Exception
public abstract <E extends java.lang.Exception> u.OptionalChar findAny(Try.CharPredicate<E> predicate) throws E extends java.lang.Exception
E extends java.lang.Exception
public abstract u.OptionalChar min()
OptionalChar
describing the minimum element of this
stream, or an empty optional if this stream is empty. This is a special
case of a reduction
and is equivalent to:
return reduce(Chareger::min);
This is a terminal operation.
OptionalChar
containing the minimum element of this
stream, or an empty OptionalChar
if the stream is emptypublic abstract u.OptionalChar max()
OptionalChar
describing the maximum element of this
stream, or an empty optional if this stream is empty. This is a special
case of a reduction
and is equivalent to:
return reduce(Chareger::max);
This is a terminal operation.
OptionalChar
containing the maximum element of this
stream, or an empty OptionalChar
if the stream is emptypublic abstract u.OptionalChar kthLargest(int k)
k
- public abstract int sum()
public abstract u.OptionalDouble average()
public abstract com.landawn.abacus.util.CharSummaryStatistics summarize()
public abstract Pair<com.landawn.abacus.util.CharSummaryStatistics,u.Optional<java.util.Map<com.landawn.abacus.util.Percentage,java.lang.Character>>> summarizeAndPercentiles()
public abstract CharStream merge(CharStream b, CharBiFunction<com.landawn.abacus.util.Nth> nextSelector)
b
- nextSelector
- first parameter is selected if Nth.FIRST
is returned, otherwise the second parameter is selected.public abstract CharStream zipWith(CharStream b, CharBinaryOperator zipFunction)
public abstract CharStream zipWith(CharStream b, CharStream c, CharTernaryOperator zipFunction)
public abstract CharStream zipWith(CharStream b, char valueForNoneA, char valueForNoneB, CharBinaryOperator zipFunction)
public abstract CharStream zipWith(CharStream b, CharStream c, char valueForNoneA, char valueForNoneB, char valueForNoneC, CharTernaryOperator zipFunction)
public abstract IntStream asIntStream()
LongStream
consisting of the elements of this stream,
converted to long
.
This is an intermediate operation.
LongStream
consisting of the elements of this stream,
converted to long
public abstract Stream<java.lang.Character> boxed()
Stream
consisting of the elements of this stream,
each boxed to an Chareger
.
This is an intermediate operation.
Stream
consistent of the elements of this stream,
each boxed to an Chareger
@SequentialOnly public CharIterator iterator()
public <R> R __(Function<? super CharStream,R> transfer)
public static CharStream empty()
@SafeVarargs public static CharStream of(char... a)
public static CharStream of(char[] a, int startIndex, int endIndex)
public static CharStream of(java.lang.CharSequence str)
str
- public static CharStream of(java.lang.CharSequence str, int startIndex, int endIndex)
str
- startIndex
- endIndex
- public static CharStream of(java.lang.Character[] a)
public static CharStream of(java.lang.Character[] a, int startIndex, int endIndex)
public static CharStream of(java.util.Collection<java.lang.Character> c)
public static CharStream of(CharIterator iterator)
public static CharStream of(Supplier<CharList> supplier)
supplier
- public static CharStream flat(char[][] a)
public static CharStream flat(char[][] a, boolean vertically)
public static CharStream flat(char[][] a, char valueForNone, boolean vertically)
public static CharStream flat(char[][][] a)
public static CharStream range(char startInclusive, char endExclusive)
public static CharStream range(char startInclusive, char endExclusive, int by)
public static CharStream rangeClosed(char startInclusive, char endInclusive)
public static CharStream rangeClosed(char startInclusive, char endInclusive, int by)
public static CharStream repeat(char element, long n)
public static CharStream random()
public static CharStream random(char startInclusive, char endExclusive)
public static CharStream random(char[] candicates)
public static CharStream iterate(BooleanSupplier hasNext, CharSupplier next)
public static CharStream iterate(char init, BooleanSupplier hasNext, CharUnaryOperator f)
public static CharStream iterate(char init, CharPredicate hasNext, CharUnaryOperator f)
init
- hasNext
- test if has next by hasNext.test(init) for first time and hasNext.test(f.apply(previous)) for remaining.f
- public static CharStream iterate(char init, CharUnaryOperator f)
public static CharStream generate(CharSupplier s)
@SafeVarargs public static CharStream concat(char[]... a)
@SafeVarargs public static CharStream concat(CharIterator... a)
@SafeVarargs public static CharStream concat(CharStream... a)
public static CharStream concat(java.util.Collection<? extends CharStream> c)
public static CharStream zip(char[] a, char[] b, CharBinaryOperator zipFunction)
a
- b
- public static CharStream zip(char[] a, char[] b, char[] c, CharTernaryOperator zipFunction)
a
- b
- c
- public static CharStream zip(CharIterator a, CharIterator b, CharBinaryOperator zipFunction)
a
- b
- public static CharStream zip(CharIterator a, CharIterator b, CharIterator c, CharTernaryOperator zipFunction)
a
- b
- public static CharStream zip(CharStream a, CharStream b, CharBinaryOperator zipFunction)
a
- b
- public static CharStream zip(CharStream a, CharStream b, CharStream c, CharTernaryOperator zipFunction)
a
- b
- public static CharStream zip(java.util.Collection<? extends CharStream> c, CharNFunction<java.lang.Character> zipFunction)
c
- zipFunction
- public static CharStream zip(char[] a, char[] b, char valueForNoneA, char valueForNoneB, CharBinaryOperator zipFunction)
a
- b
- valueForNoneA
- value to fill if "a" runs out of values first.valueForNoneB
- value to fill if "b" runs out of values first.zipFunction
- public static CharStream zip(char[] a, char[] b, char[] c, char valueForNoneA, char valueForNoneB, char valueForNoneC, CharTernaryOperator zipFunction)
a
- b
- c
- valueForNoneA
- value to fill if "a" runs out of values.valueForNoneB
- value to fill if "b" runs out of values.valueForNoneC
- value to fill if "c" runs out of values.zipFunction
- public static CharStream zip(CharIterator a, CharIterator b, char valueForNoneA, char valueForNoneB, CharBinaryOperator zipFunction)
a
- b
- valueForNoneA
- value to fill if "a" runs out of values first.valueForNoneB
- value to fill if "b" runs out of values first.zipFunction
- public static CharStream zip(CharIterator a, CharIterator b, CharIterator c, char valueForNoneA, char valueForNoneB, char valueForNoneC, CharTernaryOperator zipFunction)
a
- b
- c
- valueForNoneA
- value to fill if "a" runs out of values.valueForNoneB
- value to fill if "b" runs out of values.valueForNoneC
- value to fill if "c" runs out of values.zipFunction
- public static CharStream zip(CharStream a, CharStream b, char valueForNoneA, char valueForNoneB, CharBinaryOperator zipFunction)
a
- b
- valueForNoneA
- value to fill if "a" runs out of values first.valueForNoneB
- value to fill if "b" runs out of values first.zipFunction
- public static CharStream zip(CharStream a, CharStream b, CharStream c, char valueForNoneA, char valueForNoneB, char valueForNoneC, CharTernaryOperator zipFunction)
a
- b
- c
- valueForNoneA
- value to fill if "a" runs out of values.valueForNoneB
- value to fill if "b" runs out of values.valueForNoneC
- value to fill if "c" runs out of values.zipFunction
- public static CharStream zip(java.util.Collection<? extends CharStream> c, char[] valuesForNone, CharNFunction<java.lang.Character> zipFunction)
c
- valuesForNone
- value to fill for any iterator runs out of values.zipFunction
- public static CharStream merge(char[] a, char[] b, CharBiFunction<com.landawn.abacus.util.Nth> nextSelector)
a
- b
- nextSelector
- first parameter is selected if Nth.FIRST
is returned, otherwise the second parameter is selected.public static CharStream merge(char[] a, char[] b, char[] c, CharBiFunction<com.landawn.abacus.util.Nth> nextSelector)
a
- b
- c
- nextSelector
- first parameter is selected if Nth.FIRST
is returned, otherwise the second parameter is selected.public static CharStream merge(CharIterator a, CharIterator b, CharBiFunction<com.landawn.abacus.util.Nth> nextSelector)
a
- b
- nextSelector
- first parameter is selected if Nth.FIRST
is returned, otherwise the second parameter is selected.public static CharStream merge(CharIterator a, CharIterator b, CharIterator c, CharBiFunction<com.landawn.abacus.util.Nth> nextSelector)
a
- b
- c
- nextSelector
- first parameter is selected if Nth.FIRST
is returned, otherwise the second parameter is selected.public static CharStream merge(CharStream a, CharStream b, CharBiFunction<com.landawn.abacus.util.Nth> nextSelector)
a
- b
- nextSelector
- first parameter is selected if Nth.FIRST
is returned, otherwise the second parameter is selected.public static CharStream merge(CharStream a, CharStream b, CharStream c, CharBiFunction<com.landawn.abacus.util.Nth> nextSelector)
a
- b
- c
- nextSelector
- first parameter is selected if Nth.FIRST
is returned, otherwise the second parameter is selected.public static CharStream merge(java.util.Collection<? extends CharStream> c, CharBiFunction<com.landawn.abacus.util.Nth> nextSelector)
c
- nextSelector
- first parameter is selected if Nth.FIRST
is returned, otherwise the second parameter is selected.public static CharStream parallelMerge(java.util.Collection<? extends CharStream> c, CharBiFunction<com.landawn.abacus.util.Nth> nextSelector)
c
- nextSelector
- first parameter is selected if Nth.FIRST
is returned, otherwise the second parameter is selected.public static CharStream parallelMerge(java.util.Collection<? extends CharStream> c, CharBiFunction<com.landawn.abacus.util.Nth> nextSelector, int maxThreadNum)
c
- nextSelector
- first parameter is selected if Nth.FIRST
is returned, otherwise the second parameter is selected.maxThreadNum
- public S carry(C action)
BaseStream
peek
carry
in interface BaseStream<T,A,P,C,PL,OT,IT,ITER,S extends com.landawn.abacus.util.stream.StreamBase<T,A,P,C,PL,OT,IT,ITER,S>>
BaseStream.peek(Object)
public S slice(long from, long to)
BaseStream
stream.skip(from).limit(to - from)
.slice
in interface BaseStream<T,A,P,C,PL,OT,IT,ITER,S extends com.landawn.abacus.util.stream.StreamBase<T,A,P,C,PL,OT,IT,ITER,S>>
public Stream<S> sliding(int windowSize)
sliding
in interface BaseStream<T,A,P,C,PL,OT,IT,ITER,S extends com.landawn.abacus.util.stream.StreamBase<T,A,P,C,PL,OT,IT,ITER,S>>
BaseStream.sliding(int, int)
public Stream<PL> slidingToList(int windowSize)
slidingToList
in interface BaseStream<T,A,P,C,PL,OT,IT,ITER,S extends com.landawn.abacus.util.stream.StreamBase<T,A,P,C,PL,OT,IT,ITER,S>>
BaseStream.sliding(int, int)
public S shuffled()
BaseStream
shuffled
in interface BaseStream<T,A,P,C,PL,OT,IT,ITER,S extends com.landawn.abacus.util.stream.StreamBase<T,A,P,C,PL,OT,IT,ITER,S>>
public ImmutableList<T> toImmutableList()
toImmutableList
in interface BaseStream<T,A,P,C,PL,OT,IT,ITER,S extends com.landawn.abacus.util.stream.StreamBase<T,A,P,C,PL,OT,IT,ITER,S>>
public ImmutableSet<T> toImmutableSet()
toImmutableSet
in interface BaseStream<T,A,P,C,PL,OT,IT,ITER,S extends com.landawn.abacus.util.stream.StreamBase<T,A,P,C,PL,OT,IT,ITER,S>>
public java.lang.String join(java.lang.CharSequence delimiter)
join
in interface BaseStream<T,A,P,C,PL,OT,IT,ITER,S extends com.landawn.abacus.util.stream.StreamBase<T,A,P,C,PL,OT,IT,ITER,S>>
public void println()
println
in interface BaseStream<T,A,P,C,PL,OT,IT,ITER,S extends com.landawn.abacus.util.stream.StreamBase<T,A,P,C,PL,OT,IT,ITER,S>>
public boolean isParallel()
isParallel
in interface BaseStream<T,A,P,C,PL,OT,IT,ITER,S extends com.landawn.abacus.util.stream.StreamBase<T,A,P,C,PL,OT,IT,ITER,S>>
public S sequential()
sequential
in interface BaseStream<T,A,P,C,PL,OT,IT,ITER,S extends com.landawn.abacus.util.stream.StreamBase<T,A,P,C,PL,OT,IT,ITER,S>>
public S parallel()
parallel
in interface BaseStream<T,A,P,C,PL,OT,IT,ITER,S extends com.landawn.abacus.util.stream.StreamBase<T,A,P,C,PL,OT,IT,ITER,S>>
public S parallel(int maxThreadNum)
parallel
in interface BaseStream<T,A,P,C,PL,OT,IT,ITER,S extends com.landawn.abacus.util.stream.StreamBase<T,A,P,C,PL,OT,IT,ITER,S>>
public S parallel(BaseStream.Splitor splitor)
parallel
in interface BaseStream<T,A,P,C,PL,OT,IT,ITER,S extends com.landawn.abacus.util.stream.StreamBase<T,A,P,C,PL,OT,IT,ITER,S>>
public S parallel(java.util.concurrent.Executor exector)
parallel
in interface BaseStream<T,A,P,C,PL,OT,IT,ITER,S extends com.landawn.abacus.util.stream.StreamBase<T,A,P,C,PL,OT,IT,ITER,S>>
exector
- should be able to execute sum of maxThreadNum
operations in parallel.public void close()
close
in interface BaseStream<T,A,P,C,PL,OT,IT,ITER,S extends com.landawn.abacus.util.stream.StreamBase<T,A,P,C,PL,OT,IT,ITER,S>>
close
in interface java.lang.AutoCloseable