T
- the type of the stream elementspublic interface AsyncStream<T> extends java.util.stream.BaseStream<T,AsyncStream<T>>
Stream
.Stream
Modifier and Type | Method and Description |
---|---|
Operation<java.lang.Boolean> |
allMatch(java.util.function.Predicate<? super T> predicate)
An asynchronous equivalent to
Stream.allMatch(java.util.function.Predicate) . |
Operation<java.lang.Boolean> |
anyMatch(java.util.function.Predicate<? super T> predicate)
An asynchronous equivalent to
Stream.anyMatch(java.util.function.Predicate) . |
<R,A> Operation<R> |
collect(java.util.stream.Collector<? super T,A,R> collector)
An asynchronous equivalent to
Stream.reduce(java.util.function.BinaryOperator) . |
<R> Operation<R> |
collect(java.util.function.Supplier<R> supplier,
java.util.function.BiConsumer<R,? super T> accumulator,
java.util.function.BiConsumer<R,R> combiner)
An asynchronous equivalent to
Stream.collect(java.util.function.Supplier, java.util.function.BiConsumer, java.util.function.BiConsumer) . |
Operation<java.lang.Long> |
count()
An asynchronous equivalent to
Stream.count() . |
AsyncStream<T> |
distinct()
An asynchronous equivalent to
Stream.distinct() . |
AsyncStream<T> |
filter(java.util.function.Predicate<? super T> predicate)
An asynchronous equivalent to
Stream.filter(java.util.function.Predicate) . |
Operation<java.util.Optional<T>> |
findAny()
An asynchronous equivalent to
Stream.findAny() . |
Operation<java.util.Optional<T>> |
findFirst()
An asynchronous equivalent to
Stream.findFirst() . |
<R> AsyncStream<R> |
flatMap(java.util.function.Function<? super T,? extends java.util.stream.Stream<? extends R>> mapper)
An asynchronous equivalent to
Stream.flatMap(java.util.function.Function) . |
AsyncDoubleStream |
flatMapToDouble(java.util.function.Function<? super T,? extends java.util.stream.DoubleStream> mapper)
An asynchronous equivalent to
Stream.flatMapToDouble(java.util.function.Function) . |
AsyncIntStream |
flatMapToInt(java.util.function.Function<? super T,? extends java.util.stream.IntStream> mapper)
An asynchronous equivalent to
Stream.flatMapToInt(java.util.function.Function) . |
AsyncLongStream |
flatMapToLong(java.util.function.Function<? super T,? extends java.util.stream.LongStream> mapper)
An asynchronous equivalent to
Stream.flatMapToLong(java.util.function.Function) . |
Operation<java.lang.Void> |
forEach(java.util.function.Consumer<? super T> action)
An asynchronous equivalent to
Stream.forEach(java.util.function.Consumer) . |
Operation<java.lang.Void> |
forEachOrdered(java.util.function.Consumer<? super T> action)
An asynchronous equivalent to
Stream.forEachOrdered(java.util.function.Consumer) . |
AsyncStream<T> |
limit(long maxSize)
An asynchronous equivalent to
Stream.limit(long) . |
<R> AsyncStream<R> |
map(java.util.function.Function<? super T,? extends R> mapper)
An asynchronous equivalent to
Stream.map(java.util.function.Function) . |
AsyncDoubleStream |
mapToDouble(java.util.function.ToDoubleFunction<? super T> mapper)
An asynchronous equivalent to
Stream.mapToDouble(java.util.function.ToDoubleFunction) . |
AsyncIntStream |
mapToInt(java.util.function.ToIntFunction<? super T> mapper)
An asynchronous equivalent to
Stream.mapToInt(java.util.function.ToIntFunction) . |
AsyncLongStream |
mapToLong(java.util.function.ToLongFunction<? super T> mapper)
An asynchronous equivalent to
Stream.mapToLong(java.util.function.ToLongFunction) . |
Operation<java.util.Optional<T>> |
max(java.util.Comparator<? super T> comparator)
An asynchronous equivalent to
Stream.max(java.util.Comparator) . |
Operation<java.util.Optional<T>> |
min(java.util.Comparator<? super T> comparator)
An asynchronous equivalent to
Stream.min(java.util.Comparator) . |
Operation<java.lang.Boolean> |
noneMatch(java.util.function.Predicate<? super T> predicate)
An asynchronous equivalent to
Stream.noneMatch(java.util.function.Predicate) . |
AsyncStream<T> |
peek(java.util.function.Consumer<? super T> action)
An asynchronous equivalent to
Stream.peek(java.util.function.Consumer) . |
Operation<java.util.Optional<T>> |
reduce(java.util.function.BinaryOperator<T> accumulator)
An asynchronous equivalent to
Stream.reduce(java.util.function.BinaryOperator) . |
Operation<T> |
reduce(T identity,
java.util.function.BinaryOperator<T> accumulator)
An asynchronous equivalent to
Stream.reduce(java.lang.Object, java.util.function.BinaryOperator) . |
<U> Operation<U> |
reduce(U identity,
java.util.function.BiFunction<U,? super T,U> accumulator,
java.util.function.BinaryOperator<U> combiner)
An asynchronous equivalent to
Stream.reduce(java.lang.Object, java.util.function.BiFunction, java.util.function.BinaryOperator) . |
AsyncStream<T> |
skip(long n)
An asynchronous equivalent to
Stream.skip(long) . |
AsyncStream<T> |
sorted()
An asynchronous equivalent to
Stream.sorted() . |
AsyncStream<T> |
sorted(java.util.Comparator<? super T> comparator)
An asynchronous equivalent to
Stream.sorted(java.util.Comparator) . |
Operation<java.lang.Object[]> |
toArray()
An asynchronous equivalent to
Stream.toArray() . |
<A> Operation<A[]> |
toArray(java.util.function.IntFunction<A[]> generator)
An asynchronous equivalent to
Stream.toArray(java.util.function.IntFunction) . |
AsyncStream<T> filter(java.util.function.Predicate<? super T> predicate)
Stream.filter(java.util.function.Predicate)
.predicate
- the inclusion predicate<R> AsyncStream<R> map(java.util.function.Function<? super T,? extends R> mapper)
Stream.map(java.util.function.Function)
.R
- the element type of the new streammapper
- the element mapping functionAsyncIntStream mapToInt(java.util.function.ToIntFunction<? super T> mapper)
Stream.mapToInt(java.util.function.ToIntFunction)
.mapper
- the element mapping functionAsyncLongStream mapToLong(java.util.function.ToLongFunction<? super T> mapper)
Stream.mapToLong(java.util.function.ToLongFunction)
.mapper
- the element mapping functionAsyncDoubleStream mapToDouble(java.util.function.ToDoubleFunction<? super T> mapper)
Stream.mapToDouble(java.util.function.ToDoubleFunction)
.mapper
- the element mapping function<R> AsyncStream<R> flatMap(java.util.function.Function<? super T,? extends java.util.stream.Stream<? extends R>> mapper)
Stream.flatMap(java.util.function.Function)
.R
- the element type of the new streammapper
- the element mapping functionAsyncIntStream flatMapToInt(java.util.function.Function<? super T,? extends java.util.stream.IntStream> mapper)
Stream.flatMapToInt(java.util.function.Function)
.mapper
- the element mapping functionAsyncLongStream flatMapToLong(java.util.function.Function<? super T,? extends java.util.stream.LongStream> mapper)
Stream.flatMapToLong(java.util.function.Function)
.mapper
- the element mapping functionAsyncDoubleStream flatMapToDouble(java.util.function.Function<? super T,? extends java.util.stream.DoubleStream> mapper)
Stream.flatMapToDouble(java.util.function.Function)
.mapper
- the element mapping functionAsyncStream<T> distinct()
Stream.distinct()
.AsyncStream<T> sorted()
Stream.sorted()
.AsyncStream<T> sorted(java.util.Comparator<? super T> comparator)
Stream.sorted(java.util.Comparator)
.comparator
- comparator used to compare the elementsAsyncStream<T> peek(java.util.function.Consumer<? super T> action)
Stream.peek(java.util.function.Consumer)
.action
- action to perform on the elements as they are consumedAsyncStream<T> limit(long maxSize)
Stream.limit(long)
.maxSize
- maximum number of elementsAsyncStream<T> skip(long n)
Stream.skip(long)
.n
- number of leading elements to skipOperation<java.lang.Void> forEach(java.util.function.Consumer<? super T> action)
Stream.forEach(java.util.function.Consumer)
.action
- action to perform on the elementsOperation
representing the completion of this action across all elementsOperation<java.lang.Void> forEachOrdered(java.util.function.Consumer<? super T> action)
Stream.forEachOrdered(java.util.function.Consumer)
.action
- action to perform on the elementsOperation
representing the completion of this action across all elementsOperation<java.lang.Object[]> toArray()
Stream.toArray()
.Operation
representing the conversion of this stream to an array<A> Operation<A[]> toArray(java.util.function.IntFunction<A[]> generator)
Stream.toArray(java.util.function.IntFunction)
.A
- the element type of the arraygenerator
- a generator function for an array of the desired type and lengthOperation
representing the conversion of this stream to an arrayOperation<T> reduce(T identity, java.util.function.BinaryOperator<T> accumulator)
Stream.reduce(java.lang.Object, java.util.function.BinaryOperator)
.identity
- identity value of the accumulating functionaccumulator
- the accumulating functionOperation
representing the execution of this reductionOperation<java.util.Optional<T>> reduce(java.util.function.BinaryOperator<T> accumulator)
Stream.reduce(java.util.function.BinaryOperator)
.accumulator
- the accumulating functionOperation
representing the execution of this reduction<U> Operation<U> reduce(U identity, java.util.function.BiFunction<U,? super T,U> accumulator, java.util.function.BinaryOperator<U> combiner)
Stream.reduce(java.lang.Object, java.util.function.BiFunction, java.util.function.BinaryOperator)
.U
- the type of the resultidentity
- identity value of the accumulating functionaccumulator
- the accumulating functioncombiner
- the combining functionOperation
representing the execution of this reduction<R> Operation<R> collect(java.util.function.Supplier<R> supplier, java.util.function.BiConsumer<R,? super T> accumulator, java.util.function.BiConsumer<R,R> combiner)
Stream.collect(java.util.function.Supplier, java.util.function.BiConsumer, java.util.function.BiConsumer)
.R
- the type of the resultsupplier
- the result container supplieraccumulator
- the accumulating functioncombiner
- the combining functionOperation
representing the execution of this reduction<R,A> Operation<R> collect(java.util.stream.Collector<? super T,A,R> collector)
Stream.reduce(java.util.function.BinaryOperator)
.R
- the type of the resultA
- the intermediate accumulation typecollector
- the Collector
describing the operationOperation
representing the execution of this reductionOperation<java.util.Optional<T>> min(java.util.Comparator<? super T> comparator)
Stream.min(java.util.Comparator)
.comparator
- comparator used to compare elementsOperation
representing the calculation of the minimum valueOperation<java.util.Optional<T>> max(java.util.Comparator<? super T> comparator)
Stream.max(java.util.Comparator)
.comparator
- comparator used to compare elementsOperation
representing the calculation of the maximum valueOperation<java.lang.Long> count()
Stream.count()
.Operation
representing the length of the streamOperation<java.lang.Boolean> anyMatch(java.util.function.Predicate<? super T> predicate)
Stream.anyMatch(java.util.function.Predicate)
.predicate
- predicate to apply to the elements in the streamOperation
returning true
if at least one elements satisfies the predicateOperation<java.lang.Boolean> allMatch(java.util.function.Predicate<? super T> predicate)
Stream.allMatch(java.util.function.Predicate)
.predicate
- predicate to apply to the elements in the streamOperation
returning true
if all the elements satisfy the predicateOperation<java.lang.Boolean> noneMatch(java.util.function.Predicate<? super T> predicate)
Stream.noneMatch(java.util.function.Predicate)
.predicate
- predicate to apply to the elements in the streamOperation
returning true
if none of the elements satisfy the predicateOperation<java.util.Optional<T>> findFirst()
Stream.findFirst()
.Operation
returning the first element of the stream