public abstract class DoubleStream
extends java.lang.Object
Stream
Modifier and Type | Class and Description |
---|---|
static class |
DoubleStream.DoubleStreamEx |
BaseStream.Splitor
Modifier and Type | Method and Description |
---|---|
<R> R |
__(Function<? super DoubleStream,R> transfer) |
abstract <E extends java.lang.Exception> |
allMatch(Try.DoublePredicate<E> predicate) |
abstract <E extends java.lang.Exception> |
anyMatch(Try.DoublePredicate<E> predicate) |
abstract u.OptionalDouble |
average() |
abstract Stream<java.lang.Double> |
boxed() |
S |
carry(C action)
Same as
peek |
void |
close() |
abstract Stream<DoubleList> |
collapse(DoubleBiPredicate collapsible)
Merge series of adjacent elements which satisfy the given predicate using
the merger function and return a new stream.
|
abstract 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 <R> R |
collect(Supplier<R> supplier,
ObjDoubleConsumer<? super R> accumulator) |
abstract <R> R |
collect(Supplier<R> supplier,
ObjDoubleConsumer<? super R> accumulator,
BiConsumer<R,R> combiner) |
static DoubleStream |
concat(java.util.Collection<? extends DoubleStream> c) |
static DoubleStream |
concat(double[]... a) |
static DoubleStream |
concat(DoubleIterator... a) |
static DoubleStream |
concat(DoubleStream... a) |
static DoubleStream |
empty() |
abstract <E extends java.lang.Exception> |
findAny(Try.DoublePredicate<E> predicate) |
abstract <E extends java.lang.Exception> |
findFirst(Try.DoublePredicate<E> predicate) |
abstract <E extends java.lang.Exception,E2 extends java.lang.Exception> |
findFirstOrLast(Try.DoublePredicate<E> predicateForFirst,
Try.DoublePredicate<E> predicateForLast) |
abstract <E extends java.lang.Exception> |
findLast(Try.DoublePredicate<E> predicate) |
static DoubleStream |
flat(double[][] a) |
static DoubleStream |
flat(double[][][] a) |
static DoubleStream |
flat(double[][] a,
boolean vertically) |
static DoubleStream |
flat(double[][] a,
double valueForNone,
boolean vertically) |
abstract DoubleStream |
flatMap(DoubleFunction<? extends DoubleStream> mapper) |
abstract <T> Stream<T> |
flatMappToObj(DoubleFunction<T[]> mapper) |
abstract FloatStream |
flatMapToFloat(DoubleFunction<? extends FloatStream> mapper) |
abstract IntStream |
flatMapToInt(DoubleFunction<? extends IntStream> mapper) |
abstract LongStream |
flatMapToLong(DoubleFunction<? extends LongStream> mapper) |
abstract <T> Stream<T> |
flatMapToObj(DoubleFunction<? extends Stream<T>> mapper) |
abstract DoubleStream |
flattMap(DoubleFunction<double[]> mapper) |
abstract <T> Stream<T> |
flattMapToObj(DoubleFunction<? extends java.util.Collection<T>> mapper) |
abstract <E extends java.lang.Exception> |
forEach(Try.DoubleConsumer<E> action) |
static DoubleStream |
from(float... a) |
static DoubleStream |
from(float[] a,
int fromIndex,
int toIndex) |
static DoubleStream |
generate(DoubleSupplier s) |
boolean |
isParallel() |
static DoubleStream |
iterate(BooleanSupplier hasNext,
DoubleSupplier next) |
static DoubleStream |
iterate(double init,
BooleanSupplier hasNext,
DoubleUnaryOperator f) |
static DoubleStream |
iterate(double init,
DoublePredicate hasNext,
DoubleUnaryOperator f) |
static DoubleStream |
iterate(double init,
DoubleUnaryOperator f) |
DoubleIterator |
iterator()
Remember to close this Stream after the iteration is done, if required.
|
java.lang.String |
join(java.lang.CharSequence delimiter) |
abstract u.OptionalDouble |
kthLargest(int k) |
abstract DoubleStream |
map(DoubleUnaryOperator mapper) |
abstract FloatStream |
mapToFloat(DoubleToFloatFunction mapper) |
abstract IntStream |
mapToInt(DoubleToIntFunction mapper) |
abstract LongStream |
mapToLong(DoubleToLongFunction mapper) |
abstract <U> Stream<U> |
mapToObj(DoubleFunction<? extends U> mapper) |
abstract u.OptionalDouble |
max() |
static DoubleStream |
merge(java.util.Collection<? extends DoubleStream> c,
DoubleBiFunction<com.landawn.abacus.util.Nth> nextSelector) |
static DoubleStream |
merge(double[] a,
double[] b,
double[] c,
DoubleBiFunction<com.landawn.abacus.util.Nth> nextSelector) |
static DoubleStream |
merge(double[] a,
double[] b,
DoubleBiFunction<com.landawn.abacus.util.Nth> nextSelector) |
static DoubleStream |
merge(DoubleIterator a,
DoubleIterator b,
DoubleBiFunction<com.landawn.abacus.util.Nth> nextSelector) |
static DoubleStream |
merge(DoubleIterator a,
DoubleIterator b,
DoubleIterator c,
DoubleBiFunction<com.landawn.abacus.util.Nth> nextSelector) |
abstract DoubleStream |
merge(DoubleStream b,
DoubleBiFunction<com.landawn.abacus.util.Nth> nextSelector) |
static DoubleStream |
merge(DoubleStream a,
DoubleStream b,
DoubleBiFunction<com.landawn.abacus.util.Nth> nextSelector) |
static DoubleStream |
merge(DoubleStream a,
DoubleStream b,
DoubleStream c,
DoubleBiFunction<com.landawn.abacus.util.Nth> nextSelector) |
abstract u.OptionalDouble |
min() |
abstract <E extends java.lang.Exception> |
noneMatch(Try.DoublePredicate<E> predicate) |
static DoubleStream |
of(java.util.Collection<java.lang.Double> c) |
static DoubleStream |
of(double... a) |
static DoubleStream |
of(java.lang.Double[] a) |
static DoubleStream |
of(double[] a,
int startIndex,
int endIndex) |
static DoubleStream |
of(java.lang.Double[] a,
int startIndex,
int endIndex) |
static DoubleStream |
of(DoubleIterator iterator) |
static DoubleStream |
of(java.util.stream.DoubleStream stream) |
static DoubleStream |
of(Supplier<DoubleList> supplier)
Lazy evaluation.
|
S |
parallel() |
S |
parallel(BaseStream.Splitor splitor) |
S |
parallel(java.util.concurrent.Executor exector) |
S |
parallel(int maxThreadNum) |
static DoubleStream |
parallelMerge(java.util.Collection<? extends DoubleStream> c,
DoubleBiFunction<com.landawn.abacus.util.Nth> nextSelector) |
static DoubleStream |
parallelMerge(java.util.Collection<? extends DoubleStream> c,
DoubleBiFunction<com.landawn.abacus.util.Nth> nextSelector,
int maxThreadNum) |
void |
println() |
static DoubleStream |
random() |
abstract 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 <T> Stream<T> |
rangeMapp(DoubleBiPredicate sameRange,
DoubleBiFunction<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.OptionalDouble |
reduce(DoubleBinaryOperator op) |
abstract double |
reduce(double identity,
DoubleBinaryOperator op) |
static DoubleStream |
repeat(double element,
long n) |
abstract DoubleStream |
scan(DoubleBinaryOperator 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 DoubleStream |
scan(double init,
DoubleBinaryOperator 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 DoubleStream |
scan(double init,
DoubleBinaryOperator 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 double |
sum() |
abstract DoubleSummaryStatistics |
summarize() |
abstract Pair<DoubleSummaryStatistics,u.Optional<java.util.Map<com.landawn.abacus.util.Percentage,java.lang.Double>>> |
summarizeAndPercentiles() |
abstract DoubleList |
toDoubleList() |
ImmutableList<T> |
toImmutableList() |
ImmutableSet<T> |
toImmutableSet() |
abstract java.util.stream.DoubleStream |
toJdkStream() |
abstract <K,A,D> java.util.Map<K,D> |
toMap(DoubleFunction<? extends K> keyMapper,
Collector<java.lang.Double,A,D> downstream) |
abstract <K,A,D,M extends java.util.Map<K,D>> |
toMap(DoubleFunction<? extends K> keyMapper,
Collector<java.lang.Double,A,D> downstream,
Supplier<? extends M> mapFactory) |
abstract <K,V> java.util.Map<K,V> |
toMap(DoubleFunction<? extends K> keyMapper,
DoubleFunction<? extends V> valueMapper) |
abstract <K,V> java.util.Map<K,V> |
toMap(DoubleFunction<? extends K> keyMapper,
DoubleFunction<? extends V> valueMapper,
BinaryOperator<V> mergeFunction) |
abstract <K,V,M extends java.util.Map<K,V>> |
toMap(DoubleFunction<? extends K> keyMapper,
DoubleFunction<? extends V> valueMapper,
BinaryOperator<V> mergeFunction,
Supplier<? extends M> mapFactory) |
abstract <K,V,M extends java.util.Map<K,V>> |
toMap(DoubleFunction<? extends K> keyMapper,
DoubleFunction<? extends V> valueMapper,
Supplier<? extends M> mapFactory) |
abstract DoubleMatrix |
toMatrix() |
abstract DoubleStream |
top(int n)
This method only run sequentially, even in parallel stream. |
abstract DoubleStream |
top(int n,
java.util.Comparator<? super java.lang.Double> comparator)
This method only run sequentially, even in parallel stream. |
static DoubleStream |
zip(java.util.Collection<? extends DoubleStream> c,
double[] valuesForNone,
DoubleNFunction<java.lang.Double> zipFunction)
Zip together the iterators until all of them runs out of values.
|
static DoubleStream |
zip(java.util.Collection<? extends DoubleStream> c,
DoubleNFunction<java.lang.Double> zipFunction)
Zip together the iterators until one of them runs out of values.
|
static DoubleStream |
zip(double[] a,
double[] b,
double[] c,
double valueForNoneA,
double valueForNoneB,
double valueForNoneC,
DoubleTernaryOperator zipFunction)
Zip together the "a", "b" and "c" iterators until all of them runs out of values.
|
static DoubleStream |
zip(double[] a,
double[] b,
double[] c,
DoubleTernaryOperator zipFunction)
Zip together the "a", "b" and "c" arrays until one of them runs out of values.
|
static DoubleStream |
zip(double[] a,
double[] b,
DoubleBinaryOperator zipFunction)
Zip together the "a" and "b" arrays until one of them runs out of values.
|
static DoubleStream |
zip(double[] a,
double[] b,
double valueForNoneA,
double valueForNoneB,
DoubleBinaryOperator zipFunction)
Zip together the "a" and "b" iterators until all of them runs out of values.
|
static DoubleStream |
zip(DoubleIterator a,
DoubleIterator b,
DoubleBinaryOperator zipFunction)
Zip together the "a" and "b" iterators until one of them runs out of values.
|
static DoubleStream |
zip(DoubleIterator a,
DoubleIterator b,
double valueForNoneA,
double valueForNoneB,
DoubleBinaryOperator zipFunction)
Zip together the "a" and "b" iterators until all of them runs out of values.
|
static DoubleStream |
zip(DoubleIterator a,
DoubleIterator b,
DoubleIterator c,
double valueForNoneA,
double valueForNoneB,
double valueForNoneC,
DoubleTernaryOperator zipFunction)
Zip together the "a", "b" and "c" iterators until all of them runs out of values.
|
static DoubleStream |
zip(DoubleIterator a,
DoubleIterator b,
DoubleIterator c,
DoubleTernaryOperator zipFunction)
Zip together the "a", "b" and "c" iterators until one of them runs out of values.
|
static DoubleStream |
zip(DoubleStream a,
DoubleStream b,
DoubleBinaryOperator zipFunction)
Zip together the "a" and "b" streams until one of them runs out of values.
|
static DoubleStream |
zip(DoubleStream a,
DoubleStream b,
double valueForNoneA,
double valueForNoneB,
DoubleBinaryOperator zipFunction)
Zip together the "a" and "b" iterators until all of them runs out of values.
|
static DoubleStream |
zip(DoubleStream a,
DoubleStream b,
DoubleStream c,
double valueForNoneA,
double valueForNoneB,
double valueForNoneC,
DoubleTernaryOperator zipFunction)
Zip together the "a", "b" and "c" iterators until all of them runs out of values.
|
static DoubleStream |
zip(DoubleStream a,
DoubleStream b,
DoubleStream c,
DoubleTernaryOperator zipFunction)
Zip together the "a", "b" and "c" streams until one of them runs out of values.
|
abstract DoubleStream |
zipWith(DoubleStream b,
DoubleBinaryOperator zipFunction) |
abstract DoubleStream |
zipWith(DoubleStream b,
double valueForNoneA,
double valueForNoneB,
DoubleBinaryOperator zipFunction) |
abstract DoubleStream |
zipWith(DoubleStream b,
DoubleStream c,
double valueForNoneA,
double valueForNoneB,
double valueForNoneC,
DoubleTernaryOperator zipFunction) |
abstract DoubleStream |
zipWith(DoubleStream b,
DoubleStream c,
DoubleTernaryOperator 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 DoubleStream map(DoubleUnaryOperator mapper)
public abstract IntStream mapToInt(DoubleToIntFunction mapper)
public abstract LongStream mapToLong(DoubleToLongFunction mapper)
public abstract FloatStream mapToFloat(DoubleToFloatFunction mapper)
public abstract <U> Stream<U> mapToObj(DoubleFunction<? extends U> mapper)
public abstract DoubleStream flatMap(DoubleFunction<? extends DoubleStream> mapper)
public abstract DoubleStream flattMap(DoubleFunction<double[]> mapper)
public abstract IntStream flatMapToInt(DoubleFunction<? extends IntStream> mapper)
public abstract LongStream flatMapToLong(DoubleFunction<? extends LongStream> mapper)
public abstract FloatStream flatMapToFloat(DoubleFunction<? extends FloatStream> mapper)
public abstract <T> Stream<T> flatMapToObj(DoubleFunction<? extends Stream<T>> mapper)
public abstract <T> Stream<T> flattMapToObj(DoubleFunction<? extends java.util.Collection<T>> mapper)
public abstract <T> Stream<T> flatMappToObj(DoubleFunction<T[]> mapper)
@SequentialOnly public abstract DoubleStream rangeMap(DoubleBiPredicate sameRange, DoubleBinaryOperator 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(DoubleBiPredicate, DoubleBinaryOperator)
,
Stream.rangeMap(BiPredicate, BiFunction)
@SequentialOnly public abstract <T> Stream<T> rangeMapp(DoubleBiPredicate sameRange, DoubleBiFunction<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<DoubleList> collapse(DoubleBiPredicate collapsible)
collapsible
- @SequentialOnly public abstract DoubleStream collapse(DoubleBiPredicate collapsible, DoubleBinaryOperator mergeFunction)
collapsible
- mergeFunction
- @SequentialOnly public abstract DoubleStream scan(DoubleBinaryOperator 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 DoubleStream scan(double init, DoubleBinaryOperator 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 DoubleStream scan(double init, DoubleBinaryOperator accumulator, boolean initIncluded)
init
- accumulator
- initIncluded
- @SequentialOnly public abstract DoubleStream top(int n)
n
- @SequentialOnly public abstract DoubleStream top(int n, java.util.Comparator<? super java.lang.Double> comparator)
n
- comparator
- public abstract DoubleList toDoubleList()
public abstract <K,V> java.util.Map<K,V> toMap(DoubleFunction<? extends K> keyMapper, DoubleFunction<? extends V> valueMapper)
keyMapper
- valueMapper
- Collectors.toMap(Function, Function)
public abstract <K,V,M extends java.util.Map<K,V>> M toMap(DoubleFunction<? extends K> keyMapper, DoubleFunction<? 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(DoubleFunction<? extends K> keyMapper, DoubleFunction<? 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(DoubleFunction<? extends K> keyMapper, DoubleFunction<? 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(DoubleFunction<? extends K> keyMapper, Collector<java.lang.Double,A,D> downstream)
keyMapper
- downstream
- Collectors.groupingBy(Function, Collector)
public abstract <K,A,D,M extends java.util.Map<K,D>> M toMap(DoubleFunction<? extends K> keyMapper, Collector<java.lang.Double,A,D> downstream, Supplier<? extends M> mapFactory)
keyMapper
- downstream
- mapFactory
- Collectors.groupingBy(Function, Collector, Supplier)
public abstract DoubleMatrix toMatrix()
public abstract double reduce(double identity, DoubleBinaryOperator op)
public abstract u.OptionalDouble reduce(DoubleBinaryOperator op)
public abstract <R> R collect(Supplier<R> supplier, ObjDoubleConsumer<? super R> accumulator, BiConsumer<R,R> combiner)
public abstract <R> R collect(Supplier<R> supplier, ObjDoubleConsumer<? super R> accumulator)
public abstract <E extends java.lang.Exception> void forEach(Try.DoubleConsumer<E> action) throws E extends java.lang.Exception
E extends java.lang.Exception
public abstract <E extends java.lang.Exception> boolean anyMatch(Try.DoublePredicate<E> predicate) throws E extends java.lang.Exception
E extends java.lang.Exception
public abstract <E extends java.lang.Exception> boolean allMatch(Try.DoublePredicate<E> predicate) throws E extends java.lang.Exception
E extends java.lang.Exception
public abstract <E extends java.lang.Exception> boolean noneMatch(Try.DoublePredicate<E> predicate) throws E extends java.lang.Exception
E extends java.lang.Exception
public abstract <E extends java.lang.Exception> u.OptionalDouble findFirst(Try.DoublePredicate<E> predicate) throws E extends java.lang.Exception
E extends java.lang.Exception
public abstract <E extends java.lang.Exception> u.OptionalDouble findLast(Try.DoublePredicate<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.OptionalDouble findFirstOrLast(Try.DoublePredicate<E> predicateForFirst, Try.DoublePredicate<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.OptionalDouble findAny(Try.DoublePredicate<E> predicate) throws E extends java.lang.Exception
E extends java.lang.Exception
public abstract u.OptionalDouble min()
public abstract u.OptionalDouble max()
public abstract u.OptionalDouble kthLargest(int k)
k
- public abstract double sum()
public abstract u.OptionalDouble average()
public abstract DoubleSummaryStatistics summarize()
public abstract Pair<DoubleSummaryStatistics,u.Optional<java.util.Map<com.landawn.abacus.util.Percentage,java.lang.Double>>> summarizeAndPercentiles()
public abstract DoubleStream merge(DoubleStream b, DoubleBiFunction<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 DoubleStream zipWith(DoubleStream b, DoubleBinaryOperator zipFunction)
public abstract DoubleStream zipWith(DoubleStream b, DoubleStream c, DoubleTernaryOperator zipFunction)
public abstract DoubleStream zipWith(DoubleStream b, double valueForNoneA, double valueForNoneB, DoubleBinaryOperator zipFunction)
public abstract DoubleStream zipWith(DoubleStream b, DoubleStream c, double valueForNoneA, double valueForNoneB, double valueForNoneC, DoubleTernaryOperator zipFunction)
public abstract java.util.stream.DoubleStream toJdkStream()
public abstract Stream<java.lang.Double> boxed()
public DoubleIterator iterator()
public <R> R __(Function<? super DoubleStream,R> transfer)
public static DoubleStream empty()
@SafeVarargs public static DoubleStream of(double... a)
public static DoubleStream of(double[] a, int startIndex, int endIndex)
public static DoubleStream of(java.lang.Double[] a)
public static DoubleStream of(java.lang.Double[] a, int startIndex, int endIndex)
public static DoubleStream of(java.util.Collection<java.lang.Double> c)
public static DoubleStream of(DoubleIterator iterator)
public static DoubleStream of(Supplier<DoubleList> supplier)
supplier
- public static DoubleStream of(java.util.stream.DoubleStream stream)
public static DoubleStream flat(double[][] a)
public static DoubleStream flat(double[][] a, boolean vertically)
public static DoubleStream flat(double[][] a, double valueForNone, boolean vertically)
public static DoubleStream flat(double[][][] a)
@SafeVarargs public static DoubleStream from(float... a)
public static DoubleStream from(float[] a, int fromIndex, int toIndex)
public static DoubleStream repeat(double element, long n)
public static DoubleStream random()
public static DoubleStream iterate(BooleanSupplier hasNext, DoubleSupplier next)
public static DoubleStream iterate(double init, BooleanSupplier hasNext, DoubleUnaryOperator f)
public static DoubleStream iterate(double init, DoublePredicate hasNext, DoubleUnaryOperator 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 DoubleStream iterate(double init, DoubleUnaryOperator f)
public static DoubleStream generate(DoubleSupplier s)
@SafeVarargs public static DoubleStream concat(double[]... a)
@SafeVarargs public static DoubleStream concat(DoubleIterator... a)
@SafeVarargs public static DoubleStream concat(DoubleStream... a)
public static DoubleStream concat(java.util.Collection<? extends DoubleStream> c)
public static DoubleStream zip(double[] a, double[] b, DoubleBinaryOperator zipFunction)
a
- b
- public static DoubleStream zip(double[] a, double[] b, double[] c, DoubleTernaryOperator zipFunction)
a
- b
- c
- public static DoubleStream zip(DoubleIterator a, DoubleIterator b, DoubleBinaryOperator zipFunction)
a
- b
- public static DoubleStream zip(DoubleIterator a, DoubleIterator b, DoubleIterator c, DoubleTernaryOperator zipFunction)
a
- b
- public static DoubleStream zip(DoubleStream a, DoubleStream b, DoubleBinaryOperator zipFunction)
a
- b
- public static DoubleStream zip(DoubleStream a, DoubleStream b, DoubleStream c, DoubleTernaryOperator zipFunction)
a
- b
- public static DoubleStream zip(java.util.Collection<? extends DoubleStream> c, DoubleNFunction<java.lang.Double> zipFunction)
c
- zipFunction
- public static DoubleStream zip(double[] a, double[] b, double valueForNoneA, double valueForNoneB, DoubleBinaryOperator 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 DoubleStream zip(double[] a, double[] b, double[] c, double valueForNoneA, double valueForNoneB, double valueForNoneC, DoubleTernaryOperator 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 DoubleStream zip(DoubleIterator a, DoubleIterator b, double valueForNoneA, double valueForNoneB, DoubleBinaryOperator 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 DoubleStream zip(DoubleIterator a, DoubleIterator b, DoubleIterator c, double valueForNoneA, double valueForNoneB, double valueForNoneC, DoubleTernaryOperator 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 DoubleStream zip(DoubleStream a, DoubleStream b, double valueForNoneA, double valueForNoneB, DoubleBinaryOperator 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 DoubleStream zip(DoubleStream a, DoubleStream b, DoubleStream c, double valueForNoneA, double valueForNoneB, double valueForNoneC, DoubleTernaryOperator 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 DoubleStream zip(java.util.Collection<? extends DoubleStream> c, double[] valuesForNone, DoubleNFunction<java.lang.Double> zipFunction)
c
- valuesForNone
- value to fill for any iterator runs out of values.zipFunction
- public static DoubleStream merge(double[] a, double[] b, DoubleBiFunction<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 DoubleStream merge(double[] a, double[] b, double[] c, DoubleBiFunction<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 DoubleStream merge(DoubleIterator a, DoubleIterator b, DoubleBiFunction<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 DoubleStream merge(DoubleIterator a, DoubleIterator b, DoubleIterator c, DoubleBiFunction<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 DoubleStream merge(DoubleStream a, DoubleStream b, DoubleBiFunction<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 DoubleStream merge(DoubleStream a, DoubleStream b, DoubleStream c, DoubleBiFunction<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 DoubleStream merge(java.util.Collection<? extends DoubleStream> c, DoubleBiFunction<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 DoubleStream parallelMerge(java.util.Collection<? extends DoubleStream> c, DoubleBiFunction<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 DoubleStream parallelMerge(java.util.Collection<? extends DoubleStream> c, DoubleBiFunction<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