Uses of Annotation Interface
com.landawn.abacus.annotation.SequentialOnly
-
Uses of SequentialOnly in com.landawn.abacus.util
Modifier and TypeClassDescriptionclass
ExceptionalStream<T,
E extends Exception> The Stream will be automatically closed after execution(A terminal method is executed/triggered).interface
One-off Object.static class
One-off Object.static class
One-off Object.static class
One-off Object.static class
One-off Object.static class
One-off Object.static class
One-off Object.static class
One-off Object.static class
One-off Object.static class
One-off Object.static class
One-off Object.static class
One-off Object.static class
One-off Object.static class
One-off Object.static class
One-off Object.Modifier and TypeMethodDescriptionstatic ByteBiFunction<MergeResult>
Fn.FnB.alternated()
Deprecated.static CharBiFunction<MergeResult>
Fn.FnC.alternated()
Deprecated.static DoubleBiFunction<MergeResult>
Fn.FnD.alternated()
Deprecated.static FloatBiFunction<MergeResult>
Fn.FnF.alternated()
Deprecated.static IntBiFunction<MergeResult>
Fn.FnI.alternated()
Deprecated.static LongBiFunction<MergeResult>
Fn.FnL.alternated()
Deprecated.static ShortBiFunction<MergeResult>
Fn.FnS.alternated()
Deprecated.static <T> Predicate<T>
Fn.Predicates.concurrentDistinct()
Returns a statefulPredicate
.static <T> Predicate<T>
Fn.Predicates.concurrentDistinctBy
(Function<? super T, ?> mapper) Returns a statefulPredicate
.ExceptionalStream.cycled()
ExceptionalStream.cycled
(long times) static <T> Predicate<T>
Fn.Predicates.distinct()
Returns a statefulPredicate
.static <T> Predicate<T>
Fn.Predicates.distinctBy
(Function<? super T, ?> mapper) Returns a statefulPredicate
.static <T,
U> BiPredicate<T, U> Fn.filterThenLimit
(BiPredicate<T, U> predicate, int limit) Returns a statefulPredicate
.static <T> Predicate<T>
Fn.filterThenLimit
(Predicate<T> predicate, int limit) Returns a statefulPredicate
.static <T,
U> BiConsumer<T, U> Fn.BiConsumers.indexed
(IndexedBiConsumer<T, U> action) Returns a statefulBiPredicate
.static <T,
U, R> BiFunction<T, U, R> Fn.BiFunctions.indexed
(IndexedBiFunction<T, U, ? extends R> func) Returns a statefulBiPredicate
.static <T,
U> BiPredicate<T, U> Fn.BiPredicates.indexed
(IndexedBiPredicate<T, U> predicate) Returns a statefulBiPredicate
.static <T> Consumer<T>
Fn.Consumers.indexed
(IndexedConsumer<T> action) Returns a statefulBiPredicate
.static <T,
R> Function<T, R> Fn.Functions.indexed
(IndexedFunction<T, ? extends R> func) Returns a statefulFunction
.Fn.indexed()
Returns a statefulPredicate
.static <T> Predicate<T>
Fn.indexed
(IndexedPredicate<T> predicate) Returns a statefulPredicate
.static <T> Predicate<T>
Fn.Predicates.indexed
(IndexedPredicate<T> predicate) Returns a statefulPredicate
.static <T,
U> BiPredicate<T, U> Fn.limitThenFilter
(int limit, BiPredicate<T, U> predicate) Returns a statefulPredicate
.static <T> Predicate<T>
Fn.limitThenFilter
(int limit, Predicate<T> predicate) Returns a statefulPredicate
.static <T,
R> Function<T, R> static <T> Supplier<T>
Returns aSupplier
which returns a single instance created by calling the specifiedsupplier.get()
.Fn.Factory.ofDisposableArray()
static <T> IntFunction<NoCachingNoUpdating.DisposableArray<T>>
Fn.Factory.ofDisposableArray
(Class<T> componentType) static <T,
C extends Collection<T>>
IntFunction<? extends C>Fn.reuse
(IntFunction<? extends C> supplier) Deprecated.static <T,
C extends Collection<T>>
Supplier<? extends C>Deprecated.static <T,
C extends Collection<T>>
IntFunction<? extends C>Fn.Factory.single
(IntFunction<? extends C> supplier) Deprecated.static <T,
C extends Collection<T>>
Supplier<? extends C>Deprecated.static <T> Predicate<T>
Fn.Predicates.skipRepeats()
Returns a statefulPredicate
.static <T> BiFunction<T,
T, MergeResult> Fn.switchOnNext()
Returns a statefulBiFunction
.static <T> BiFunction<T,
T, MergeResult> MergeResult.switchOnNext()
Deprecated.static <T> Predicate<T>
Fn.timeLimit
(long timeInMillis) Returns a statefulPredicate
.static <T> Predicate<T>
Returns a statefulPredicate
. -
Uses of SequentialOnly in com.landawn.abacus.util.stream
Modifier and TypeMethodDescription<SS extends BaseStream>
SSabstract ByteStream
ByteStream.append
(byte... a) abstract CharStream
CharStream.append
(char... a) abstract DoubleStream
DoubleStream.append
(double... a) EntryStream.append
(M map) abstract FloatStream
FloatStream.append
(float... a) abstract IntStream
IntStream.append
(int... a) abstract LongStream
LongStream.append
(long... a) abstract ShortStream
ShortStream.append
(short... a) Stream.append
(Collection<? extends T> c) BaseStream.appendIfEmpty
(Supplier<? extends S> supplier) abstract ByteStream
ByteStream.appendIfEmpty
(byte... a) abstract CharStream
CharStream.appendIfEmpty
(char... a) abstract DoubleStream
DoubleStream.appendIfEmpty
(double... a) EntryStream.appendIfEmpty
(M map) abstract FloatStream
FloatStream.appendIfEmpty
(float... a) abstract IntStream
IntStream.appendIfEmpty
(int... a) abstract LongStream
LongStream.appendIfEmpty
(long... a) abstract ShortStream
ShortStream.appendIfEmpty
(short... a) Stream.appendIfEmpty
(Collection<? extends T> c) Stream.appendIfEmpty
(T... a) abstract DoubleStream
FloatStream.asDoubleStream()
abstract DoubleStream
IntStream.asDoubleStream()
abstract DoubleStream
LongStream.asDoubleStream()
abstract FloatStream
IntStream.asFloatStream()
abstract FloatStream
LongStream.asFloatStream()
Deprecated.abstract IntStream
ByteStream.asIntStream()
abstract IntStream
CharStream.asIntStream()
Returns aLongStream
consisting of the elements of this stream, converted tolong
.abstract IntStream
ShortStream.asIntStream()
abstract LongStream
IntStream.asLongStream()
abstract u.OptionalDouble
ByteStream.average()
abstract u.OptionalDouble
CharStream.average()
abstract u.OptionalDouble
DoubleStream.average()
abstract u.OptionalDouble
FloatStream.average()
abstract u.OptionalDouble
IntStream.average()
abstract u.OptionalDouble
LongStream.average()
abstract u.OptionalDouble
ShortStream.average()
BiIterator<K,
V> EntryStream.biIterator()
Remember to close this Stream after the iteration is done, if needed.ByteStream.boxed()
CharStream.boxed()
Returns aStream
consisting of the elements of this stream, each boxed to anChareger
.DoubleStream.boxed()
FloatStream.boxed()
IntStream.boxed()
LongStream.boxed()
ShortStream.boxed()
Stream.buffered()
Returns a new Stream with elements from a temporary queue which is filled by reading the elements from this Stream asynchronously with a new thread.Stream.buffered
(int bufferSize) Returns a new Stream with elements from a temporary queue which is filled by reading the elements from this Stream asynchronously with a new thread.Stream.cartesianProduct
(Collection<? extends Collection<? extends T>> cs) Stream.cartesianProduct
(Collection<? extends T>... cs) <KK,
VV> EntryStream<KK, VV> EntryStream.chain
(Function<? super Stream<Map.Entry<K, V>>, ? extends Stream<Map.Entry<KK, VV>>> transfer) <E extends Exception>
ExceptionalStream<T,E> Stream.checked()
<E extends Exception>
ExceptionalStream<T,E> ByteStream.collapse
(ByteBiPredicate collapsible) Merge series of adjacent elements which satisfy the given predicate using the merger function and return a new stream.abstract ByteStream
ByteStream.collapse
(ByteBiPredicate collapsible, ByteBinaryOperator mergeFunction) Merge series of adjacent elements which satisfy the given predicate using the merger function and return a new stream.abstract ByteStream
ByteStream.collapse
(ByteTriPredicate collapsible, ByteBinaryOperator mergeFunction) CharStream.collapse
(CharBiPredicate collapsible) Merge series of adjacent elements which satisfy the given predicate using the merger function and return a new stream.abstract CharStream
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 CharStream
CharStream.collapse
(CharTriPredicate collapsible, CharBinaryOperator mergeFunction) abstract Stream<DoubleList>
DoubleStream.collapse
(DoubleBiPredicate collapsible) Merge series of adjacent elements which satisfy the given predicate using the merger function and return a new stream.abstract DoubleStream
DoubleStream.collapse
(DoubleBiPredicate collapsible, DoubleBinaryOperator mergeFunction) Merge series of adjacent elements which satisfy the given predicate using the merger function and return a new stream.abstract DoubleStream
DoubleStream.collapse
(DoubleTriPredicate collapsible, DoubleBinaryOperator mergeFunction) FloatStream.collapse
(FloatBiPredicate collapsible) Merge series of adjacent elements which satisfy the given predicate using the merger function and return a new stream.abstract FloatStream
FloatStream.collapse
(FloatBiPredicate collapsible, FloatBinaryOperator mergeFunction) Merge series of adjacent elements which satisfy the given predicate using the merger function and return a new stream.abstract FloatStream
FloatStream.collapse
(FloatTriPredicate collapsible, FloatBinaryOperator mergeFunction) IntStream.collapse
(IntBiPredicate collapsible) Merge series of adjacent elements which satisfy the given predicate using the merger function and return a new stream.abstract IntStream
IntStream.collapse
(IntBiPredicate collapsible, IntBinaryOperator mergeFunction) Merge series of adjacent elements which satisfy the given predicate using the merger function and return a new stream.abstract IntStream
IntStream.collapse
(IntTriPredicate collapsible, IntBinaryOperator mergeFunction) LongStream.collapse
(LongBiPredicate collapsible) Merge series of adjacent elements which satisfy the given predicate using the merger function and return a new stream.abstract LongStream
LongStream.collapse
(LongBiPredicate collapsible, LongBinaryOperator mergeFunction) Merge series of adjacent elements which satisfy the given predicate using the merger function and return a new stream.abstract LongStream
LongStream.collapse
(LongTriPredicate collapsible, LongBinaryOperator mergeFunction) ShortStream.collapse
(ShortBiPredicate collapsible) Merge series of adjacent elements which satisfy the given predicate using the merger function and return a new stream.abstract ShortStream
ShortStream.collapse
(ShortBiPredicate collapsible, ShortBinaryOperator mergeFunction) abstract ShortStream
ShortStream.collapse
(ShortTriPredicate collapsible, ShortBinaryOperator mergeFunction) Stream.collapse
(TriPredicate<? super T, ? super T, ? super T> collapsible) Stream.collapse
(TriPredicate<? super T, ? super T, ? super T> collapsible, BiFunction<? super T, ? super T, T> mergeFunction) Merge series of adjacent elements which satisfy the given predicate using the merger function and return a new stream.abstract <C extends Collection<T>>
Stream<C>Stream.collapse
(TriPredicate<? super T, ? super T, ? super T> collapsible, Supplier<? extends C> supplier) abstract <R> Stream<R>
Stream.collapse
(TriPredicate<? super T, ? super T, ? super T> collapsible, Supplier<R> supplier, BiConsumer<? super R, ? super T> accumulator) abstract <R,
A> Stream<R> Stream.collapse
(TriPredicate<? super T, ? super T, ? super T> collapsible, Collector<? super T, A, R> collector) Merge series of adjacent elements which satisfy the given predicate using the merger function and return a new stream.abstract <U> Stream<U>
Stream.collapse
(TriPredicate<? super T, ? super T, ? super T> collapsible, U init, BiFunction<U, ? super T, U> op) Stream.collapse
(BiPredicate<? super T, ? super T> collapsible) Stream.collapse
(BiPredicate<? super T, ? super T> collapsible, BiFunction<? super T, ? super T, T> mergeFunction) Merge series of adjacent elements which satisfy the given predicate using the merger function and return a new stream.abstract <C extends Collection<T>>
Stream<C>Stream.collapse
(BiPredicate<? super T, ? super T> collapsible, Supplier<? extends C> supplier) abstract <R> Stream<R>
Stream.collapse
(BiPredicate<? super T, ? super T> collapsible, Supplier<R> supplier, BiConsumer<? super R, ? super T> accumulator) abstract <R,
A> Stream<R> Merge series of adjacent elements which satisfy the given predicate using the merger function and return a new stream.abstract <U> Stream<U>
Stream.collapse
(BiPredicate<? super T, ? super T> collapsible, U init, BiFunction<U, ? super T, U> op) EntryStream.collapseByKey
(BiPredicate<? super K, ? super K> collapsible) <R,
A> Stream<R> EntryStream.collapseByKey
(BiPredicate<? super K, ? super K> collapsible, Collector<? super V, A, R> collector) Merge series of adjacent elements which satisfy the given predicate using the merger function and return a new stream.Stream.combinations()
Stream.of(1, 2, 3).combinations().forEach(Fn.println()); // output [] [1] [2] [3] [1, 2] [1, 3] [2, 3] [1, 2, 3]
Stream.combinations
(int len) Stream.of(1, 2, 3).combinations(2).forEach(Fn.println()); // output [1, 2] [1, 3] [2, 3]
Stream.combinations
(int len, boolean repeat) It's same asN.cartesianProduct(N.repeat(toList(), len))
ifrepeat
istrue
.abstract boolean
Stream.containsAll
(Collection<? extends T> c) abstract boolean
Stream.containsAll
(T... a) abstract boolean
Stream.containsAny
(Collection<? extends T> c) abstract boolean
Stream.containsAny
(T... a) long
BaseStream.count()
BaseStream.cycled()
This method only runs sequentially, even in parallel stream and retrieved elements will be saved in memory for next cycle.BaseStream.cycled
(long rounds)
This method only runs sequentially, even in parallel stream and retrieved elements will be saved in memory for next cycle.Stream.defaultIfEmpty
(Supplier<? extends Stream<T>> supplier) Stream.defaultIfEmpty
(T defaultValue) BaseStream.difference
(Collection<?> c)
This method only runs sequentially, even in parallel stream.BaseStream.distinct()
Returns a stream consisting of the distinct elements of this stream.Distinct and filter by occurrences.EntryStream.distinctByKey()
EntryStream.distinctByValue()
BaseStream.elementAt
(long position) EntryStream.entries()
abstract <E extends Exception,
E2 extends Exception>
u.Optional<T>Stream.findFirstOrLast
(Throwables.Predicate<? super T, E> predicateForFirst, Throwables.Predicate<? super T, E2> predicateForLast) abstract <U,
E extends Exception, E2 extends Exception>
u.Optional<T>Stream.findFirstOrLast
(Function<? super T, U> preFunc, Throwables.BiPredicate<? super T, ? super U, E> predicateForFirst, Throwables.BiPredicate<? super T, ? super U, E2> predicateForLast)
This method only runs sequentially, even in parallel stream.abstract <U,
E extends Exception, E2 extends Exception>
u.Optional<T>Stream.findFirstOrLast
(U init, Throwables.BiPredicate<? super T, ? super U, E> predicateForFirst, Throwables.BiPredicate<? super T, ? super U, E2> predicateForLast)
This method only runs sequentially, even in parallel stream.BaseStream.first()
<KK> EntryStream<KK,
V> EntryStream.flatmapKeyToDisposableEntry
(Function<? super K, ? extends Collection<? extends KK>> keyMapper) Deprecated.<KK> EntryStream<KK,
V> EntryStream.flatMapKeyToDisposableEntry
(Function<? super K, ? extends Stream<? extends KK>> keyMapper) Deprecated.<VV> EntryStream<K,
VV> EntryStream.flatmapValueToDisposableEntry
(Function<? super V, ? extends Collection<? extends VV>> valueMapper) Deprecated.<VV> EntryStream<K,
VV> EntryStream.flatMapValueToDisposableEntry
(Function<? super V, ? extends Stream<? extends VV>> valueMapper) Deprecated.abstract <E extends Exception>
u.Optional<T>Stream.foldLeft
(Throwables.BinaryOperator<T, E> accumulator) This method will always run sequentially, even in parallel stream.abstract <U,
E extends Exception>
UStream.foldLeft
(U identity, Throwables.BiFunction<U, ? super T, U, E> accumulator) This method will always run sequentially, even in parallel stream.abstract <E extends Exception>
u.Optional<T>Stream.foldRight
(Throwables.BinaryOperator<T, E> accumulator) This method will always run sequentially, even in parallel stream.abstract <U,
E extends Exception>
UStream.foldRight
(U identity, Throwables.BiFunction<U, ? super T, U, E> accumulator) This method will always run sequentially, even in parallel stream.EntryStream<K,
List<V>> EntryStream.groupBy()
EntryStream.groupBy
(BinaryOperator<V> mergeFunction) EntryStream<K,
List<V>> EntryStream.groupTo()
<R,
E extends Exception>
REntryStream.groupToAndThen
(Throwables.Function<? super Map<K, List<V>>, ? extends R, E> func) abstract boolean
Stream.hasDuplicates()
BaseStream.indexed()
This method only runs sequentially, even in parallel stream.BaseStream.intersection
(Collection<?> c)
This method only runs sequentially, even in parallel stream.Stream.intersperse
(T delimiter) Stream.of(1).intersperse(9) --> [1]
Stream.of(1, 2, 3).intersperse(9) --> [1, 9, 2, 9, 3]
This method only runs sequentially, even in parallel stream.EntryStream.inversed()
EntryStream.inversedToDisposableEntry()
Deprecated.BaseStream.iterator()
Deprecated.? may cause memory/resource leak if forget to close thisStream
FloatStream.iterator()
Remember to close this Stream after the iteration is done, if needed.IntStream.iterator()
Remember to close this Stream after the iteration is done, if needed.LongStream.iterator()
Remember to close this Stream after the iteration is done, if needed.ShortStream.iterator()
Remember to close this Stream after the iteration is done, if needed.Stream.iterator()
Remember to close this Stream after the iteration is done, if needed.BaseStream.join
(CharSequence delimiter) BaseStream.join
(CharSequence delimiter, CharSequence prefix, CharSequence suffix) EntryStream.join
(CharSequence delimiter, CharSequence keyValueDelimiter) EntryStream.join
(CharSequence delimiter, CharSequence keyValueDelimiter, CharSequence prefix, CharSequence suffix) abstract String
EntryStream.keys()
abstract u.OptionalByte
ByteStream.kthLargest
(int k) abstract u.OptionalChar
CharStream.kthLargest
(int k) abstract u.OptionalDouble
DoubleStream.kthLargest
(int k) abstract u.OptionalFloat
FloatStream.kthLargest
(int k) abstract u.OptionalInt
IntStream.kthLargest
(int k) abstract u.OptionalLong
LongStream.kthLargest
(int k) abstract u.OptionalShort
ShortStream.kthLargest
(int k) BaseStream.last()
Stream.last
(int n) A queue with size up ton
will be maintained to filter out the lastn
elements.BaseStream.limit
(long maxSize) EntryStream.limit
(long maxSize) <KK,
VV> EntryStream<KK, VV> EntryStream.mapToDisposableEntry
(BiFunction<? super K, ? super V, ? extends KK> keyMapper, BiFunction<? super K, ? super V, ? extends VV> valueMapper) Deprecated.<KK,
VV> EntryStream<KK, VV> EntryStream.mapToDisposableEntry
(Function<? super Map.Entry<K, V>, ? extends KK> keyMapper, Function<? super Map.Entry<K, V>, ? extends VV> valueMapper) Deprecated.<K,
V> Stream<NoCachingNoUpdating.DisposableEntry<K, V>> Stream.mapToDisposableEntry
(Function<? super T, ? extends K> keyMapper, Function<? super T, ? extends V> valueMapper) Deprecated.abstract u.OptionalByte
ByteStream.max()
abstract u.OptionalChar
CharStream.max()
Returns anOptionalChar
describing the maximum element of this stream, or an empty optional if this stream is empty.abstract u.OptionalDouble
DoubleStream.max()
abstract u.OptionalFloat
FloatStream.max()
abstract u.OptionalInt
IntStream.max()
abstract u.OptionalLong
LongStream.max()
abstract u.OptionalShort
ShortStream.max()
abstract ByteStream
ByteStream.mergeWith
(ByteStream b, ByteBiFunction<MergeResult> nextSelector) abstract CharStream
CharStream.mergeWith
(CharStream b, CharBiFunction<MergeResult> nextSelector) abstract DoubleStream
DoubleStream.mergeWith
(DoubleStream b, DoubleBiFunction<MergeResult> nextSelector) abstract FloatStream
FloatStream.mergeWith
(FloatStream b, FloatBiFunction<MergeResult> nextSelector) abstract IntStream
IntStream.mergeWith
(IntStream b, IntBiFunction<MergeResult> nextSelector) abstract LongStream
LongStream.mergeWith
(LongStream b, LongBiFunction<MergeResult> nextSelector) abstract ShortStream
ShortStream.mergeWith
(ShortStream b, ShortBiFunction<MergeResult> nextSelector) Stream.mergeWith
(Stream<? extends T> b, BiFunction<? super T, ? super T, MergeResult> nextSelector) Stream.mergeWith
(Collection<? extends T> b, BiFunction<? super T, ? super T, MergeResult> nextSelector) abstract u.OptionalByte
ByteStream.min()
abstract u.OptionalChar
CharStream.min()
Returns anOptionalChar
describing the minimum element of this stream, or an empty optional if this stream is empty.abstract u.OptionalDouble
DoubleStream.min()
abstract u.OptionalFloat
FloatStream.min()
abstract u.OptionalInt
IntStream.min()
abstract u.OptionalLong
LongStream.min()
abstract u.OptionalShort
ShortStream.min()
BaseStream.onlyOne()
Stream.orderedPermutations()
Stream.of(1, 2, 3).orderedPermutations().forEach(Fn.println()); // output [1, 2, 3] [1, 3, 2] [2, 1, 3] [2, 3, 1] [3, 1, 2] [3, 2, 1]
Stream.orderedPermutations
(Comparator<? super T> comparator) BaseStream.parallel()
Consider usingsps(Function)
if only next operation need to be parallelized.BaseStream.parallel
(int maxThreadNum) Consider usingsps(int, Function)
if only next operation need to be parallelized.BaseStream.parallel
(int maxThreadNum, BaseStream.Splitor splitor) Returns an equivalent stream that is parallel.BaseStream.parallel
(int maxThreadNum, BaseStream.Splitor splitor, Executor executor) stream.parallel(maxThreadNum, splitor, executor).map(f).filter(p)...; // Replace above line of code with "sps" if only "f" need to be parallelized.// Replace above line of code with "sps" if only "f" need to be parallelized.BaseStream.parallel
(BaseStream.ParallelSettings ps) stream.parallel(parallelSettings).map(f).filter(p)...; // Replace above line of code with "sps" if only "f" need to be parallelized.BaseStream.parallel
(BaseStream.Splitor splitor) stream.parallel(executor).map(f).filter(p)...; // Replace above line of code with "sps" if only "f" need to be parallelized.BaseStream.percentiles()
All elements will be loaded to memory and sorted if not yet.abstract u.Optional<Map<Percentage,
T>> Stream.percentiles
(Comparator<? super T> comparator) Stream.permutations()
Stream.of(1, 2, 3).permutations().forEach(Fn.println()); // output [1, 2, 3] [1, 3, 2] [3, 1, 2] [3, 2, 1] [2, 3, 1] [2, 1, 3]
abstract long
Stream.persist
(Throwables.BiConsumer<? super T, Writer, IOException> writeLine, File file) abstract long
Stream.persist
(Throwables.BiConsumer<? super T, Writer, IOException> writeLine, Writer writer) abstract long
Stream.persist
(Throwables.BiConsumer<? super T, Writer, IOException> writeLine, String header, String tail, File file) abstract long
Stream.persist
(Throwables.BiConsumer<? super T, Writer, IOException> writeLine, String header, String tail, Writer writer) abstract long
Stream.persist
(Throwables.Function<? super T, String, IOException> toLine, File file) toCSV:abstract long
Stream.persist
(Throwables.Function<? super T, String, IOException> toLine, OutputStream os) abstract long
Stream.persist
(Throwables.Function<? super T, String, IOException> toLine, Writer writer) toCSV:abstract long
Stream.persist
(Throwables.Function<? super T, String, IOException> toLine, String header, String tail, File file) abstract long
Stream.persist
(Throwables.Function<? super T, String, IOException> toLine, String header, String tail, Writer writer) abstract long
abstract long
abstract long
Stream.persist
(Connection conn, String insertSQL, int batchSize, long batchIntervalInMillis, Throwables.BiConsumer<? super T, ? super PreparedStatement, SQLException> stmtSetter) abstract long
Stream.persist
(PreparedStatement stmt, int batchSize, long batchIntervalInMillis, Throwables.BiConsumer<? super T, ? super PreparedStatement, SQLException> stmtSetter) abstract long
Stream.persistToCSV
(File file) Each line in the output file/Writer is an array of JSON String without root bracket.abstract long
Stream.persistToCSV
(OutputStream os) Each line in the output file/Writer is an array of JSON String without root bracket.abstract long
Stream.persistToCSV
(Writer writer) Each line in the output file/Writer is an array of JSON String without root bracket.abstract long
Stream.persistToCSV
(Collection<String> csvHeaders, File file) Each line in the output file/Writer is an array of JSON String without root bracket.abstract long
Stream.persistToCSV
(Collection<String> csvHeaders, OutputStream os) Each line in the output file/Writer is an array of JSON String without root bracket.abstract long
Stream.persistToCSV
(Collection<String> csvHeaders, Writer writer) Each line in the output file/Writer is an array of JSON String without root bracket.abstract ByteStream
ByteStream.prepend
(byte... a) abstract CharStream
CharStream.prepend
(char... a) abstract DoubleStream
DoubleStream.prepend
(double... a) EntryStream.prepend
(M map) abstract FloatStream
FloatStream.prepend
(float... a) abstract IntStream
IntStream.prepend
(int... a) abstract LongStream
LongStream.prepend
(long... a) abstract ShortStream
ShortStream.prepend
(short... a) Stream.prepend
(Collection<? extends T> c) void
BaseStream.println()
<SS extends BaseStream>
SSTemporarily switch the stream to sequence stream for operationops
and then switch back to parallel stream with samemaxThreadNum/splitor/asyncExecutor
.abstract ByteStream
ByteStream.rangeMap
(ByteBiPredicate sameRange, ByteBinaryOperator 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 CharStream
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 DoubleStream
DoubleStream.rangeMap
(DoubleBiPredicate sameRange, DoubleBinaryOperator 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 FloatStream
FloatStream.rangeMap
(FloatBiPredicate sameRange, FloatBinaryOperator 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 IntStream
IntStream.rangeMap
(IntBiPredicate sameRange, IntBinaryOperator 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 LongStream
LongStream.rangeMap
(LongBiPredicate sameRange, LongBinaryOperator 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 ShortStream
ShortStream.rangeMap
(ShortBiPredicate sameRange, ShortBinaryOperator 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> Stream<U>
Stream.rangeMap
(BiPredicate<? super T, ? super T> sameRange, BiFunction<? super T, ? super T, ? extends U> 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>
ByteStream.rangeMapToObj
(ByteBiPredicate sameRange, ByteBiFunction<? extends 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 <T> Stream<T>
CharStream.rangeMapToObj
(CharBiPredicate sameRange, CharBiFunction<? extends 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 <T> Stream<T>
DoubleStream.rangeMapToObj
(DoubleBiPredicate sameRange, DoubleBiFunction<? extends 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 <T> Stream<T>
FloatStream.rangeMapToObj
(FloatBiPredicate sameRange, FloatBiFunction<? extends 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 <T> Stream<T>
IntStream.rangeMapToObj
(IntBiPredicate sameRange, IntBiFunction<? extends 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 <T> Stream<T>
LongStream.rangeMapToObj
(LongBiPredicate sameRange, LongBiFunction<? extends 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 <T> Stream<T>
ShortStream.rangeMapToObj
(ShortBiPredicate sameRange, ShortBiFunction<? extends 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.BaseStream.rateLimited
(double permitsPerSecond) BaseStream.rateLimited
(RateLimiter rateLimiter) EntryStream.reduce
(Map.Entry<K, V> identity, Throwables.BinaryOperator<Map.Entry<K, V>, E> accumulator) BaseStream.reversed()
This method only runs sequentially, even in parallel stream and all elements will be loaded to memory.Stream.rollup()
BaseStream.rotated
(int distance)
This method only runs sequentially, even in parallel stream and all elements will be loaded to memory.abstract ByteStream
ByteStream.scan
(byte init, ByteBinaryOperator accumulator) Returns aStream
produced by iterative application of a accumulation function to an initial elementinit
and next element of the current stream.abstract ByteStream
ByteStream.scan
(byte init, ByteBinaryOperator accumulator, boolean initIncluded) abstract ByteStream
ByteStream.scan
(ByteBinaryOperator accumulator) Returns aStream
produced by iterative application of a accumulation function to an initial elementinit
and next element of the current stream.abstract CharStream
CharStream.scan
(char init, CharBinaryOperator accumulator) Returns aStream
produced by iterative application of a accumulation function to an initial elementinit
and next element of the current stream.abstract CharStream
CharStream.scan
(char init, CharBinaryOperator accumulator, boolean initIncluded) abstract CharStream
CharStream.scan
(CharBinaryOperator accumulator) Returns aStream
produced by iterative application of a accumulation function to an initial elementinit
and next element of the current stream.abstract DoubleStream
DoubleStream.scan
(double init, DoubleBinaryOperator accumulator) Returns aStream
produced by iterative application of a accumulation function to an initial elementinit
and next element of the current stream.abstract DoubleStream
DoubleStream.scan
(double init, DoubleBinaryOperator accumulator, boolean initIncluded) abstract DoubleStream
DoubleStream.scan
(DoubleBinaryOperator accumulator) Returns aStream
produced by iterative application of a accumulation function to an initial elementinit
and next element of the current stream.abstract FloatStream
FloatStream.scan
(float init, FloatBinaryOperator accumulator) Returns aStream
produced by iterative application of a accumulation function to an initial elementinit
and next element of the current stream.abstract FloatStream
FloatStream.scan
(float init, FloatBinaryOperator accumulator, boolean initIncluded) abstract FloatStream
FloatStream.scan
(FloatBinaryOperator accumulator) Returns aStream
produced by iterative application of a accumulation function to an initial elementinit
and next element of the current stream.abstract IntStream
IntStream.scan
(int init, IntBinaryOperator accumulator) Returns aStream
produced by iterative application of a accumulation function to an initial elementinit
and next element of the current stream.abstract IntStream
IntStream.scan
(int init, IntBinaryOperator accumulator, boolean initIncluded) abstract IntStream
IntStream.scan
(IntBinaryOperator accumulator) Returns aStream
produced by iterative application of a accumulation function to an initial elementinit
and next element of the current stream.abstract LongStream
LongStream.scan
(long init, LongBinaryOperator accumulator) Returns aStream
produced by iterative application of a accumulation function to an initial elementinit
and next element of the current stream.abstract LongStream
LongStream.scan
(long init, LongBinaryOperator accumulator, boolean initIncluded) abstract LongStream
LongStream.scan
(LongBinaryOperator accumulator) Returns aStream
produced by iterative application of a accumulation function to an initial elementinit
and next element of the current stream.abstract ShortStream
ShortStream.scan
(short init, ShortBinaryOperator accumulator) Returns aStream
produced by iterative application of a accumulation function to an initial elementinit
and next element of the current stream.abstract ShortStream
ShortStream.scan
(short init, ShortBinaryOperator accumulator, boolean initIncluded) abstract ShortStream
ShortStream.scan
(ShortBinaryOperator accumulator) Returns aStream
produced by iterative application of a accumulation function to an initial elementinit
and next element of the current stream.Stream.scan
(BiFunction<? super T, ? super T, T> accumulator) Returns aStream
produced by iterative application of a accumulation function to an initial elementinit
and next element of the current stream.abstract <U> Stream<U>
Stream.scan
(U init, BiFunction<U, ? super T, U> accumulator) Returns aStream
produced by iterative application of a accumulation function to an initial elementinit
and next element of the current stream.abstract <U> Stream<U>
Stream.scan
(U init, BiFunction<U, ? super T, U> accumulator, boolean initIncluded) <U> Stream<U>
Select the elements belong to the specifiedtargetType
(including its subtype).<KK> EntryStream<KK,
V> EntryStream.selectByKey
(Class<KK> clazz) Returns a stream consisting of the elements of this stream which keys are instances of given class.<VV> EntryStream<K,
VV> EntryStream.selectByValue
(Class<VV> clazz) Returns a stream consisting of the elements of this stream which values are instances of given class.BaseStream.sequential()
BaseStream.shuffled()
This method only runs sequentially, even in parallel stream and all elements will be loaded to memory.
This method only runs sequentially, even in parallel stream and all elements will be loaded to memory.BaseStream.skip
(long n) EntryStream.skip
(long n) Stream.skipLast
(int n) A queue with size up ton
will be maintained to filter out the lastn
elements.Stream.skipNull()
Stream.skipRange
(int startInclusive, int endExclusive) Skip the range: [fromIndexInclusive, fromIndexInclusive].BaseStream.sliding
(int windowSize) BaseStream.sliding
(int windowSize, int increment) Stream.of(1, 2, 3, 4, 5, 6, 7, 8).sliding(3, 1).forEach(Stream::println)
output:
[1, 2, 3]
[2, 3, 4]
[3, 4, 5]
[4, 5, 6]
[5, 6, 7]
[6, 7, 8]
============================================================================Stream.of(1, 2, 3, 4, 5, 6, 7, 8).sliding(3, 3).forEach(Stream::println)
output:
[1, 2, 3]
[4, 5, 6]
[7, 8]
============================================================================Stream.of(1, 2, 3, 4, 5, 6, 7, 5).sliding(3, 5).forEach(Stream::println)
output:
[1, 2, 3]
[6, 7, 8]
This method only runs sequentially, even in parallel stream.abstract <C extends Collection<T>>
Stream<C>Stream.sliding
(int windowSize, int increment, IntFunction<? extends C> collectionSupplier) abstract <A,
R> Stream<R> abstract <C extends Collection<T>>
Stream<C>Stream.sliding
(int windowSize, IntFunction<? extends C> collectionSupplier) abstract <A,
R> Stream<R> BaseStream.slidingToList
(int windowSize) BaseStream.slidingToList
(int windowSize, int increment) Stream.slidingToSet
(int windowSize) Stream.slidingToSet
(int windowSize, int increment) BaseStream.split
(int chunkSize) Returns Stream ofS
with consecutive sub sequences of the elements, each of the same size (the final sequence may be smaller).Split the stream by the specified predicate.abstract <C extends Collection<T>>
Stream<C>Stream.split
(int chunkSize, IntFunction<? extends C> collectionSupplier) Returns Stream of Stream with consecutive sub sequences of the elements, each of the same size (the final sequence may be smaller).abstract <A,
R> Stream<R> abstract <C extends Collection<T>>
Stream<C>abstract <A,
R> Stream<R> BaseStream.splitAt
(int where) Split the stream into two pieces atwhere
.Split the stream into two pieces atwhere
turns totrue
.abstract <A,
R> Stream<R> Split the stream into two pieces atwhere
turns tofalse
.abstract <A,
R> Stream<R> Split the stream into two pieces atwhere
turns tofalse
.BaseStream.splitToList
(int chunkSize) Returns Stream ofPL
with consecutive sub sequences of the elements, each of the same size (the final sequence may be smaller).BaseStream.splitToList
(P predicate) Split the stream by the specified predicate.Stream.splitToSet
(int chunkSize) Returns Stream of Stream with consecutive sub sequences of the elements, each of the same size (the final sequence may be smaller).Stream.splitToSet
(Predicate<? super T> predicate) <SS extends BaseStream>
SSTemporarily switch the stream to parallel stream for operationops
and then switch back to sequence stream.<SS extends BaseStream>
SSTemporarily switch the stream to parallel stream for operationops
and then switch back to sequence stream.BaseStream.step
(long step) abstract long
ByteStream.sum()
abstract long
CharStream.sum()
abstract double
DoubleStream.sum()
abstract double
FloatStream.sum()
abstract long
IntStream.sum()
abstract long
LongStream.sum()
abstract long
ShortStream.sum()
abstract ByteSummaryStatistics
ByteStream.summarize()
abstract CharSummaryStatistics
CharStream.summarize()
abstract DoubleSummaryStatistics
DoubleStream.summarize()
abstract FloatSummaryStatistics
FloatStream.summarize()
abstract IntSummaryStatistics
IntStream.summarize()
abstract LongSummaryStatistics
LongStream.summarize()
abstract ShortSummaryStatistics
ShortStream.summarize()
abstract Pair<ByteSummaryStatistics,
u.Optional<Map<Percentage, Byte>>> ByteStream.summarizeAndPercentiles()
abstract Pair<CharSummaryStatistics,
u.Optional<Map<Percentage, Character>>> CharStream.summarizeAndPercentiles()
abstract Pair<DoubleSummaryStatistics,
u.Optional<Map<Percentage, Double>>> DoubleStream.summarizeAndPercentiles()
abstract Pair<FloatSummaryStatistics,
u.Optional<Map<Percentage, Float>>> FloatStream.summarizeAndPercentiles()
abstract Pair<IntSummaryStatistics,
u.Optional<Map<Percentage, Integer>>> IntStream.summarizeAndPercentiles()
abstract Pair<LongSummaryStatistics,
u.Optional<Map<Percentage, Long>>> LongStream.summarizeAndPercentiles()
abstract Pair<ShortSummaryStatistics,
u.Optional<Map<Percentage, Short>>> ShortStream.summarizeAndPercentiles()
BaseStream.symmetricDifference
(Collection<T> c)
This method only runs sequentially, even in parallel stream.BaseStream.throwIfEmpty
(Supplier<? extends RuntimeException> exceptionSupplier) BaseStream.toArray()
abstract <A> A[]
Stream.toArray
(IntFunction<A[]> generator) abstract ByteList
ByteStream.toByteList()
abstract CharList
CharStream.toCharList()
<CC extends Collection<T>>
CCBaseStream.toCollection
(Supplier<? extends CC> supplier) abstract <R,
CC extends Collection<T>, E extends Exception>
RStream.toCollectionAndThen
(Supplier<? extends CC> supplier, Throwables.Function<? super CC, ? extends R, E> func) abstract DataSet
Stream.toDataSet()
The first row will be used as column names if its type is array or list, or obtain the column names from first row if its type is bean or map.abstract DataSet
If the specifiedcolumnNames
is null or empty, the first row will be used as column names if its type is array or list, or obtain the column names from first row if its type is bean or map.abstract DoubleList
DoubleStream.toDoubleList()
abstract FloatList
FloatStream.toFloatList()
BaseStream.toImmutableList()
EntryStream.toImmutableMap()
EntryStream.toImmutableMap
(BinaryOperator<V> mergeFunction) BaseStream.toImmutableSet()
abstract IntList
IntStream.toIntList()
abstract DoubleStream
DoubleStream.toJdkStream()
abstract IntStream
IntStream.toJdkStream()
abstract LongStream
LongStream.toJdkStream()
Stream.toJdkStream()
Remember to close this Stream after the iteration is done, if needed.BaseStream.toList()
abstract <R,
E extends Exception>
RStream.toListAndThen
(Throwables.Function<? super List<T>, ? extends R, E> func) abstract LongList
LongStream.toLongList()
BaseStream.toLongMultiset()
BaseStream.toLongMultiset
(Supplier<? extends LongMultiset<T>> supplier) EntryStream.toMap()
EntryStream.toMap
(BinaryOperator<V> mergeFunction) EntryStream.toMap
(BinaryOperator<V> mergeFunction, Supplier<? extends M> mapFactory) <R,
E extends Exception>
REntryStream.toMapAndThen
(Throwables.Function<? super Map<K, V>, ? extends R, E> func) EntryStream.toMultimap()
<C extends Collection<V>,
M extends Multimap<K, V, C>>
MEntryStream.toMultimap
(Supplier<? extends M> mapFactory) BaseStream.toMultiset()
BaseStream.toMultiset
(Supplier<? extends Multiset<T>> supplier) abstract DoubleStream
DoubleStream.top
(int n)
This method only runs sequentially, even in parallel stream.abstract DoubleStream
DoubleStream.top
(int n, Comparator<? super Double> comparator)
This method only runs sequentially, even in parallel stream.abstract FloatStream
FloatStream.top
(int n)
This method only runs sequentially, even in parallel stream.abstract FloatStream
FloatStream.top
(int n, Comparator<? super Float> comparator)
This method only runs sequentially, even in parallel stream.abstract IntStream
IntStream.top
(int n)
This method only runs sequentially, even in parallel stream.abstract IntStream
IntStream.top
(int n, Comparator<? super Integer> comparator)
This method only runs sequentially, even in parallel stream.abstract LongStream
LongStream.top
(int n)
This method only runs sequentially, even in parallel stream.abstract LongStream
LongStream.top
(int n, Comparator<? super Long> comparator)
This method only runs sequentially, even in parallel stream.abstract ShortStream
ShortStream.top
(int n)
This method only runs sequentially, even in parallel stream.abstract ShortStream
ShortStream.top
(int n, Comparator<? super Short> comparator)
This method only runs sequentially, even in parallel stream.Stream.top
(int n)
This method only runs sequentially, even in parallel stream.Stream.top
(int n, Comparator<? super T> comparator)
This method only runs sequentially, even in parallel stream.BaseStream.toSet()
abstract <R,
E extends Exception>
RStream.toSetAndThen
(Throwables.Function<? super Set<T>, ? extends R, E> func) abstract ShortList
ShortStream.toShortList()
EntryStream.values()
Fn.switchOnNext()
instead