T - public class ReactiveStreamImpl<T> extends java.lang.Object implements ReactiveStream<T>
LazyStream.Empty<T>, LazyStream.LazyCons<T>javaslang.collection.Stream.Cons<T>serialVersionUID| Modifier and Type | Method and Description |
|---|---|
ReactiveStream<T> |
appendSelf(java.util.function.Function<? super javaslang.collection.Stream<T>,? extends javaslang.collection.Stream<T>> mapper)
Appends itself to the end of stream with
mapper function. |
boolean |
equals(java.lang.Object obj) |
<R1,R> ReactiveStream<R> |
forEach2(java.util.function.Function<? super T,? extends java.lang.Iterable<R1>> stream1,
java.util.function.Function<? super T,java.util.function.Function<? super R1,? extends R>> yieldingFunction)
Perform a two level nested internal iteration over this Stream and the
supplied stream
|
<R1,R> ReactiveStream<R> |
forEach2(java.util.function.Function<? super T,? extends java.lang.Iterable<R1>> stream1,
java.util.function.Function<? super T,java.util.function.Function<? super R1,java.lang.Boolean>> filterFunction,
java.util.function.Function<? super T,java.util.function.Function<? super R1,? extends R>> yieldingFunction)
Perform a two level nested internal iteration over this Stream and the
supplied stream
|
<R1,R2,R> ReactiveStream<R> |
forEach3(java.util.function.Function<? super T,? extends java.lang.Iterable<R1>> stream1,
java.util.function.Function<? super T,java.util.function.Function<? super R1,? extends java.lang.Iterable<R2>>> stream2,
java.util.function.Function<? super T,java.util.function.Function<? super R1,java.util.function.Function<? super R2,? extends R>>> yieldingFunction)
Perform a three level nested internal iteration over this Stream and the
supplied streams
|
<R1,R2,R> ReactiveStream<R> |
forEach3(java.util.function.Function<? super T,? extends java.lang.Iterable<R1>> stream1,
java.util.function.Function<? super T,java.util.function.Function<? super R1,? extends java.lang.Iterable<R2>>> stream2,
java.util.function.Function<? super T,java.util.function.Function<? super R1,java.util.function.Function<? super R2,java.lang.Boolean>>> filterFunction,
java.util.function.Function<? super T,java.util.function.Function<? super R1,java.util.function.Function<? super R2,? extends R>>> yieldingFunction)
Perform a three level nested internal iteration over this Stream and the
supplied streams
|
<X extends java.lang.Throwable> |
forEachEvent(java.util.function.Consumer<? super T> consumerElement,
java.util.function.Consumer<? super java.lang.Throwable> consumerError,
java.lang.Runnable onComplete) |
<X extends java.lang.Throwable> |
forEachWithError(java.util.function.Consumer<? super T> consumerElement,
java.util.function.Consumer<? super java.lang.Throwable> consumerError) |
<X extends java.lang.Throwable> |
forEachX(long numberOfElements,
java.util.function.Consumer<? super T> consumer) |
<X extends java.lang.Throwable> |
forEachXEvents(long numberOfElements,
java.util.function.Consumer<? super T> consumer,
java.util.function.Consumer<? super java.lang.Throwable> consumerError,
java.lang.Runnable onComplete) |
<X extends java.lang.Throwable> |
forEachXWithError(long numberOfElements,
java.util.function.Consumer<? super T> consumer,
java.util.function.Consumer<? super java.lang.Throwable> consumerError) |
int |
hashCode() |
T |
head() |
boolean |
isEmpty() |
java.util.function.Supplier<T> |
lazyHead() |
java.util.stream.Stream<T> |
parallel() |
LazyStream<T> |
toStream() |
java.lang.String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, waitappend, append, appendAll, asyncMap, asyncRetry, cast, clear, combinations, combinations, cons, crossProduct, crossProduct, crossProduct, cycle, cycle, cycleUntil, cycleWhile, debounce, distinct, distinctBy, distinctBy, drop, drop, dropRight, dropWhile, elapsed, empty, filter, fixedDelay, flatMap, flatten, foldRight, foldRight2, from, from, fromAnyM, fromAsyncQueue, fromIterable, fromIterator, fromJDK, fromStream, fromStreamable, futureOperations, generate, groupByReactive, hotStream, init, initOptionReactive, insert, insertAll, intersperse, iterate, iterator, jitter, map, mapReduce, mapReduce, of, ofType, onEmpty, onEmptyGet, onEmptySwitch, onEmptyThrow, onePer, padTo, partitionReactive, patch, pausedHotStream, peek, permutations, prepend, prepend, prependAll, range, range, recover, recover, reduce, reduce, remove, removeAll, removeAll, removeAt, removeBetween, removeFirst, removeLast, replace, replaceAll, retainAll, retry, reverse, scanLeft, scanLeft, scanRight, scanRight, schedule, scheduleFixedDelay, scheduleFixedRate, single, single, singleOption, slice, slidingWindow, slidingWindow, sort, sort, sortBy, sortBy, spanReactive, splitAtInclusiveReactive, splitAtReactive, splitAtReactive, subscribe, subscribeAsync, subscriber, subSequence, subSequence, subStream, tail, tailOptionReactive, take, take, takeRight, takeUntil, takeWhile, timestamp, trampoline, unit, unzip3Reactive, unzipReactive, update, windowBySize, windowBySizeAndTime, windowByTime, windowStatefullyWhile, windowUntil, windowWhile, xMatch, xPer, zip, zipAll, zipAnyM, zipWithIndexanyM, collect, collect, collectable, collector, dropUntil, fill, futures, futures, futureStream, futureStream, gen, gen, get, groupBy, grouped, hasDefiniteSize, headOption, indexOf, initOption, isTraversableAgain, lastIndexOf, length, match, ofAll, ofAll, ofAll, ofAll, ofAll, ofAll, ofAll, ofAll, ofAll, partition, range, rangeBy, rangeBy, rangeBy, rangeBy, rangeClosed, rangeClosed, rangeClosed, rangeClosedBy, rangeClosedBy, rangeClosedBy, rangeClosedBy, repeat, scan, seq, sequenceM, sliding, sliding, span, splitAt, splitAt, splitAtInclusive, spliterator, stream, streamable, stringPrefix, tabulate, tailOption, toAsyncBlockingQueue, toAsyncQueue, toAsyncQueue, toCollection, toTraversable, unzip, unzip3indexWhere, lastIndexOfSlice, lastIndexWhere, reverseIterator, segmentLengthapply, containsSlice, endsWith, foldRight, indexOf, indexOfSlice, indexOfSlice, indexWhere, iterator, lastIndexOf, lastIndexOfSlice, lastIndexWhere, prefixLength, startsWith, startsWith, transformaverage, containsAll, count, existsUnique, find, findLast, foldLeft, get, hash, isSingleValued, last, lastOption, max, maxBy, maxBy, min, minBy, minBy, mkString, mkString, mkString, product, reduceLeft, reduceLeftOption, reduceRight, reduceRightOption, size, sumcontains, corresponds, eq, exists, forAll, forEach, getOption, getOrElse, getOrElse, getOrElseThrow, getOrElseTry, isDefined, out, out, stderr, stdout, toArray, toCharSeq, toJavaArray, toJavaArray, toJavaList, toJavaMap, toJavaOptional, toJavaSet, toJavaStream, toLeft, toLeft, toList, toMap, toOption, toQueue, toRight, toRight, toSet, toStack, toTree, toTry, toTry, toVectorpublic java.lang.String toString()
toString in interface javaslang.Value<T>toString in class java.lang.Objectpublic int hashCode()
hashCode in interface javaslang.Value<T>hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in interface javaslang.Value<T>equals in class java.lang.Objectpublic ReactiveStream<T> appendSelf(java.util.function.Function<? super javaslang.collection.Stream<T>,? extends javaslang.collection.Stream<T>> mapper)
LazyStreammapper function.
Example:
Well known scala code for Fibonacci infinite sequence
val fibs:Stream[Int] = 0 #:: 1 #:: (fibs zip fibs.tail).map{ t => t._1 + t._2 }
can be transformed to
Stream.of(0, 1).appendSelf(self -> self.zip(self.tail()).map(t -> t._1 + t._2));
appendSelf in interface LazyStream<T>appendSelf in interface javaslang.collection.Stream<T>mapper - an mapperpublic java.util.stream.Stream<T> parallel()
public LazyStream<T> toStream()
toStream in interface LazyStream<T>toStream in interface javaslang.Value<T>public <X extends java.lang.Throwable> org.reactivestreams.Subscription forEachX(long numberOfElements,
java.util.function.Consumer<? super T> consumer)
forEachX in interface com.aol.cyclops.sequence.reactivestreams.ReactiveStreamsTerminalOperations<T>public <X extends java.lang.Throwable> org.reactivestreams.Subscription forEachXWithError(long numberOfElements,
java.util.function.Consumer<? super T> consumer,
java.util.function.Consumer<? super java.lang.Throwable> consumerError)
forEachXWithError in interface com.aol.cyclops.sequence.reactivestreams.ReactiveStreamsTerminalOperations<T>public <X extends java.lang.Throwable> org.reactivestreams.Subscription forEachXEvents(long numberOfElements,
java.util.function.Consumer<? super T> consumer,
java.util.function.Consumer<? super java.lang.Throwable> consumerError,
java.lang.Runnable onComplete)
forEachXEvents in interface com.aol.cyclops.sequence.reactivestreams.ReactiveStreamsTerminalOperations<T>public <X extends java.lang.Throwable> void forEachWithError(java.util.function.Consumer<? super T> consumerElement, java.util.function.Consumer<? super java.lang.Throwable> consumerError)
forEachWithError in interface com.aol.cyclops.sequence.reactivestreams.ReactiveStreamsTerminalOperations<T>public <X extends java.lang.Throwable> void forEachEvent(java.util.function.Consumer<? super T> consumerElement, java.util.function.Consumer<? super java.lang.Throwable> consumerError, java.lang.Runnable onComplete)
forEachEvent in interface com.aol.cyclops.sequence.reactivestreams.ReactiveStreamsTerminalOperations<T>public <R1,R2,R> ReactiveStream<R> forEach3(java.util.function.Function<? super T,? extends java.lang.Iterable<R1>> stream1, java.util.function.Function<? super T,java.util.function.Function<? super R1,? extends java.lang.Iterable<R2>>> stream2, java.util.function.Function<? super T,java.util.function.Function<? super R1,java.util.function.Function<? super R2,? extends R>>> yieldingFunction)
ReactiveStream
SequenceM.of(1,2)
.forEach3(a->IntStream.range(10,13),
a->b->Stream.of(""+(a+b),"hello world"),
a->b->c->c+":"a+":"+b);
//SequenceM[11:1:2,hello world:1:2,14:1:4,hello world:1:4,12:1:2,hello world:1:2,15:1:5,hello world:1:5]
forEach3 in interface ReactiveStream<T>stream1 - Nested Stream to iterate overstream2 - Nested Stream to iterate overyieldingFunction - Function with pointers to the current element from both
Streams that generates the new elementspublic <R1,R2,R> ReactiveStream<R> forEach3(java.util.function.Function<? super T,? extends java.lang.Iterable<R1>> stream1, java.util.function.Function<? super T,java.util.function.Function<? super R1,? extends java.lang.Iterable<R2>>> stream2, java.util.function.Function<? super T,java.util.function.Function<? super R1,java.util.function.Function<? super R2,java.lang.Boolean>>> filterFunction, java.util.function.Function<? super T,java.util.function.Function<? super R1,java.util.function.Function<? super R2,? extends R>>> yieldingFunction)
ReactiveStream
SequenceM.of(1,2,3)
.forEach3(a->IntStream.range(10,13),
a->b->Stream.of(""+(a+b),"hello world"),
a->b->c-> c!=3,
a->b->c->c+":"a+":"+b);
//SequenceM[11:1:2,hello world:1:2,14:1:4,hello world:1:4,12:1:2,hello world:1:2,15:1:5,hello world:1:5]
forEach3 in interface ReactiveStream<T>stream1 - Nested Stream to iterate overstream2 - Nested Stream to iterate overfilterFunction - Filter to apply over elements before passing non-filtered
values to the yielding functionyieldingFunction - Function with pointers to the current element from both
Streams that generates the new elementspublic <R1,R> ReactiveStream<R> forEach2(java.util.function.Function<? super T,? extends java.lang.Iterable<R1>> stream1, java.util.function.Function<? super T,java.util.function.Function<? super R1,? extends R>> yieldingFunction)
ReactiveStream
SequenceM.of(1,2,3)
.forEach2(a->IntStream.range(10,13),
a->b->a+b);
//SequenceM[11,14,12,15,13,16]
forEach2 in interface ReactiveStream<T>stream1 - Nested Stream to iterate overyieldingFunction - Function with pointers to the current element from both
Streams that generates the new elementspublic <R1,R> ReactiveStream<R> forEach2(java.util.function.Function<? super T,? extends java.lang.Iterable<R1>> stream1, java.util.function.Function<? super T,java.util.function.Function<? super R1,java.lang.Boolean>> filterFunction, java.util.function.Function<? super T,java.util.function.Function<? super R1,? extends R>> yieldingFunction)
ReactiveStream
SequenceM.of(1,2,3)
.forEach2(a->IntStream.range(10,13),
a->b-> a<3 && b>10,
a->b->a+b);
//SequenceM[14,15]
forEach2 in interface ReactiveStream<T>stream1 - Nested Stream to iterate overfilterFunction - Filter to apply over elements before passing non-filtered
values to the yielding functionyieldingFunction - Function with pointers to the current element from both
Streams that generates the new elementspublic boolean isEmpty()
public java.util.function.Supplier<T> lazyHead()
lazyHead in interface LazyStream<T>