T
- Data type of elements within the Streampublic interface ReactiveSeq<T> extends To<ReactiveSeq<T>>, Unwrapable, java.util.stream.Stream<T>, OnEmptySwitch<T,java.util.stream.Stream<T>>, FoldableTraversable<T>, Unit<T>, ConvertableSequence<T>, Higher<ReactiveSeq.µ,T>
Modifier and Type | Interface and Description |
---|---|
static class |
ReactiveSeq.µ |
static class |
ReactiveSeq.Instances |
java.util.stream.Stream.Builder<T>
Fn1.FunctionalOperations<T1,R>
Modifier and Type | Method and Description |
---|---|
boolean |
allMatch(java.util.function.Predicate<? super T> c)
True if predicate matches all elements when Monad converted to a Stream
|
AnyMSeq<Witness.reactiveSeq,T> |
anyM() |
boolean |
anyMatch(java.util.function.Predicate<? super T> c)
True if a single element matches when Monad converted to a Stream
|
ReactiveSeq<T> |
append(java.lang.Iterable<? extends T> other) |
ReactiveSeq<T> |
append(T... values)
Append values to the take of this ReactiveSeq
|
ReactiveSeq<T> |
append(T value) |
ReactiveSeq<T> |
appendS(java.util.stream.Stream<? extends T> other)
Append Stream to this ReactiveSeq
|
default <U> ReactiveSeq<U> |
cast(java.lang.Class<? extends U> type)
Cast all elements in a stream to a given type, possibly throwing a
ClassCastException . |
default <R> ReactiveSeq<R> |
coflatMap(java.util.function.Function<? super ReactiveSeq<T>,? extends R> fn)
coflatMap pattern, can be used to perform lazy reductions / collections / folds and other terminal operations
|
default <R,A> R |
collect(java.util.stream.Collector<? super T,A,R> collector)
Performs a mutable
reduction operation on the elements of this stream using a
Collector . |
default <R> R |
collect(java.util.function.Supplier<R> supplier,
java.util.function.BiConsumer<R,? super T> accumulator,
java.util.function.BiConsumer<R,R> combiner)
Performs a mutable
reduction operation on the elements of this stream.
|
<A,R> ReactiveSeq<R> |
collectSeq(java.util.stream.Collector<? super T,A,R> c) |
default ReactiveSeq<ReactiveSeq<T>> |
combinations()
ReactiveSeq.of(1,2,3).combinations()
//ReactiveSeq[ReactiveSeq[],ReactiveSeq[1],ReactiveSeq[2],ReactiveSeq[3].ReactiveSeq[1,2],ReactiveSeq[1,3],ReactiveSeq[2,3]
,ReactiveSeq[1,2,3]]
|
default ReactiveSeq<ReactiveSeq<T>> |
combinations(int size)
ReactiveSeq.of(1,2,3).combinations(2)
//ReactiveSeq[ReactiveSeq[1,2],ReactiveSeq[1,3],ReactiveSeq[2,3]]
|
default ReactiveSeq<T> |
combine(java.util.function.BiPredicate<? super T,? super T> predicate,
java.util.function.BinaryOperator<T> op)
Combine two adjacent elements in a traversable using the supplied BinaryOperator
This is a stateful grouping and reduction operation.
|
static <T> ReactiveSeq<T> |
concat(java.util.Spliterator<? extends T>... array) |
static <T> ReactiveSeq<T> |
concat(java.util.Spliterator<? extends T> left,
java.util.Spliterator<? extends T> right) |
static <T> ReactiveSeq<T> |
concat(java.util.stream.Stream<? extends T>... streams) |
static <T> ReactiveSeq<T> |
concat(java.util.stream.Stream<? extends T> left,
java.util.stream.Stream<? extends T> right) |
static java.util.function.Function<? super ReactiveSeq<java.lang.Double>,? extends ReactiveSeq<java.lang.Double>> |
concatDoubles(ReactiveSeq<java.lang.Double> b) |
static java.util.function.Function<? super ReactiveSeq<java.lang.Integer>,? extends ReactiveSeq<java.lang.Integer>> |
concatInts(ReactiveSeq<java.lang.Integer> b) |
static java.util.function.Function<? super ReactiveSeq<java.lang.Long>,? extends ReactiveSeq<java.lang.Long>> |
concatLongs(ReactiveSeq<java.lang.Long> b) |
long |
count()
Returns the count of elements in this stream.
|
ReactiveSeq<T> |
cycle()
Convert to a Stream with the values infinitely cycled
|
ReactiveSeq<T> |
cycle(long times)
Convert to a Stream with the values repeated specified times
|
ReactiveSeq<T> |
cycle(Monoid<T> m,
long times)
Convert to a Stream with the result of a reduction operation repeated
specified times
|
ReactiveSeq<T> |
cycleUntil(java.util.function.Predicate<? super T> predicate)
Repeat in a Stream until specified predicate holds
|
ReactiveSeq<T> |
cycleWhile(java.util.function.Predicate<? super T> predicate)
Repeat in a Stream while specified predicate holds
|
ReactiveSeq<T> |
debounce(long time,
java.util.concurrent.TimeUnit t)
Allow one element through per time period, drop all other elements in
that time period
|
static <T> ReactiveSeq<T> |
defered(java.util.function.Supplier<? extends java.util.stream.Stream<? extends T>> lazy) |
static <T> ReactiveSeq<T> |
deferedI(java.util.function.Supplier<? extends java.lang.Iterable<? extends T>> lazy) |
static <T> ReactiveSeq<T> |
deferedP(java.util.function.Supplier<? extends org.reactivestreams.Publisher<? extends T>> lazy) |
ReactiveSeq<T> |
deleteBetween(int start,
int end)
Delete elements between given indexes in a Stream
|
ReactiveSeq<T> |
distinct() |
<U> ReactiveSeq<T> |
distinct(java.util.function.Function<? super T,? extends U> keyExtractor) |
default ReactiveSeq<java.lang.Double> |
doubles(java.util.function.ToDoubleFunction<? super T> fn,
java.util.function.Function<? super java.util.stream.DoubleStream,? extends java.util.stream.DoubleStream> mapper)
Peform intermediate operations on a primitive IntStream (gives improved performance when working with Integers)
If this ReactiveSeq has an OfInt Spliterator it will be converted directly to an IntStream,
otherwise the provided conversion function will be used.
|
default ReactiveSeq<T> |
drop(long drop)
assertThat(ReactiveSeq.of(4,3,6,7).drop(2).toList(),equalTo(Arrays.asList(6,7))); |
default ReactiveSeq<T> |
dropRight(int num)
Generate a new Traversable that drops the specified number elements from the take of this Traversable
|
default ReactiveSeq<T> |
dropUntil(java.util.function.Predicate<? super T> p)
Generate a new Traversable that drops elements from this Traversable until the predicate holds
|
default ReactiveSeq<T> |
dropWhile(java.util.function.Predicate<? super T> p)
Generate a new Traversable that drops elements from this Traversable as long as the predicate holds
|
org.jooq.lambda.tuple.Tuple2<ReactiveSeq<T>,ReactiveSeq<T>> |
duplicate()
Duplicate a Stream, buffers intermediate values, leaders may change
positions so a limit can be safely applied to the leading stream.
|
default ReactiveSeq<org.jooq.lambda.tuple.Tuple2<T,java.lang.Long>> |
elapsed()
ReactiveSeq.of(1,2,3,4,5)
.elapsed()
.forEach(System.out::println);
|
default org.jooq.lambda.tuple.Tuple2<T,ReactiveSeq<T>> |
elementAt(long index)
Gets the element at index, and returns a Tuple containing the element (it
must be present) and a lazy copy of the Sequence for further processing.
|
static <T> ReactiveSeq<T> |
empty() |
boolean |
endsWith(java.util.stream.Stream<T> stream)
assertTrue(ReactiveSeq.of(1,2,3,4,5,6)
.endsWith(Stream.of(5,6)));
|
boolean |
endsWithIterable(java.lang.Iterable<T> iterable)
assertTrue(ReactiveSeq.of(1,2,3,4,5,6)
.endsWith(Arrays.asList(5,6)));
|
static <T> ReactiveSeq<T> |
fill(T t)
Construct a Stream consisting of a single value repeatedly infinitely (use take / drop etc to
switch to a finite Stream)
|
ReactiveSeq<T> |
filter(java.util.function.Predicate<? super T> fn)
Keep only elements for which the supplied predicates hold
e.g.
|
static java.util.function.Function<? super ReactiveSeq<java.lang.Integer>,? extends ReactiveSeq<java.lang.Integer>> |
filterInts(java.util.function.IntPredicate b) |
static java.util.function.Function<? super ReactiveSeq<java.lang.Double>,? extends ReactiveSeq<java.lang.Double>> |
filterLongs(java.util.function.DoublePredicate b) |
static java.util.function.Function<? super ReactiveSeq<java.lang.Long>,? extends ReactiveSeq<java.lang.Long>> |
filterLongs(java.util.function.LongPredicate b) |
default ReactiveSeq<T> |
filterNot(java.util.function.Predicate<? super T> predicate)
Remove any elements for which the predicate holds (inverse operation to filter)
e.g.
|
java.util.Optional<T> |
findAny() |
java.util.Optional<T> |
findFirst() |
T |
firstValue()
assertThat(ReactiveSeq.of(1,2,3,4)
.map(u->{throw new RuntimeException();})
.recover(e->"hello")
.firstValue(),equalTo("hello"));
|
ReactiveSeq<T> |
fixedDelay(long l,
java.util.concurrent.TimeUnit unit)
emit elements after a fixed delay
|
<R> ReactiveSeq<R> |
flatMap(java.util.function.Function<? super T,? extends java.util.stream.Stream<? extends R>> fn)
flatMap operation
|
<R> ReactiveSeq<R> |
flatMapAnyM(java.util.function.Function<? super T,AnyM<Witness.stream,? extends R>> fn)
Allows flatMap return type to be any Monad type
|
static java.util.function.Function<? super ReactiveSeq<java.lang.Double>,? extends ReactiveSeq<java.lang.Double>> |
flatMapDoubles(java.util.function.DoubleFunction<? extends java.util.stream.DoubleStream> b) |
<R> ReactiveSeq<R> |
flatMapI(java.util.function.Function<? super T,? extends java.lang.Iterable<? extends R>> fn)
FlatMap where the result is a Collection, flattens the resultant
collections into the host ReactiveSeq
|
static java.util.function.Function<? super ReactiveSeq<java.lang.Integer>,? extends ReactiveSeq<java.lang.Integer>> |
flatMapInts(java.util.function.IntFunction<? extends java.util.stream.IntStream> b) |
static java.util.function.Function<? super ReactiveSeq<java.lang.Long>,? extends ReactiveSeq<java.lang.Long>> |
flatMapLongs(java.util.function.LongFunction<? extends java.util.stream.LongStream> b) |
<R> ReactiveSeq<R> |
flatMapP(java.util.function.Function<? super T,? extends org.reactivestreams.Publisher<? extends R>> fn) |
<R> ReactiveSeq<R> |
flatMapStream(java.util.function.Function<? super T,java.util.stream.BaseStream<? extends R,?>> fn)
flatMap operation
|
static <T1> ReactiveSeq<T1> |
flatten(ReactiveSeq<? extends ReactiveSeq<T1>> nested)
join / flatten one level of a nested hierarchy
|
static <T1> ReactiveSeq<T1> |
flattenI(ReactiveSeq<? extends java.lang.Iterable<T1>> nested) |
static <T1> ReactiveSeq<T1> |
flattenO(ReactiveSeq<? extends java.util.Optional<T1>> nested) |
ReactiveSeq<T> |
fold(Monoid<T> monoid) |
default <R> R |
foldJooλ(java.util.function.Function<? super org.jooq.lambda.Seq<T>,? extends R> mapper) |
default <R> R |
foldParallel(java.util.concurrent.ForkJoinPool fj,
java.util.function.Function<? super java.util.stream.Stream<T>,? extends R> fn) |
default <R> R |
foldParallel(java.util.function.Function<? super java.util.stream.Stream<T>,? extends R> fn) |
T |
foldRight(Monoid<T> reducer)
ReactiveSeq.of("a","b","c").foldRight(Reducers.toString(""));
// "cab"
|
T |
foldRight(T identity,
java.util.function.BinaryOperator<T> accumulator)
Immutable reduction from right to left
|
<U> U |
foldRight(U identity,
java.util.function.BiFunction<? super T,? super U,? extends U> accumulator)
Immutable reduction from right to left
|
<T> T |
foldRightMapToType(Reducer<T> reducer)
Attempt to map this Monad to the same type as the supplied Monoid (using
mapToType on the monoid interface) Then use Monoid to reduce values
|
void |
forEach(java.util.function.Consumer<? super T> action)
Performs an action for each element of this stream.
|
default <R1,R> ReactiveSeq<R> |
forEach2(java.util.function.Function<? super T,? extends java.util.stream.BaseStream<R1,?>> stream1,
java.util.function.BiFunction<? super T,? super R1,? extends R> yieldingFunction)
Perform a two level nested internal iteration over this Stream and the
supplied stream
|
default <R1,R> ReactiveSeq<R> |
forEach2(java.util.function.Function<? super T,? extends java.util.stream.BaseStream<R1,?>> stream1,
java.util.function.BiFunction<? super T,? super R1,java.lang.Boolean> filterFunction,
java.util.function.BiFunction<? super T,? super R1,? extends R> yieldingFunction)
Perform a two level nested internal iteration over this Stream and the
supplied stream
|
default <R1,R2,R> ReactiveSeq<R> |
forEach3(java.util.function.Function<? super T,? extends java.util.stream.BaseStream<R1,?>> stream1,
java.util.function.BiFunction<? super T,? super R1,? extends java.util.stream.BaseStream<R2,?>> stream2,
Fn3<? super T,? super R1,? super R2,? extends R> yieldingFunction)
Perform a three level nested internal iteration over this Stream and the
supplied streams
|
default <R1,R2,R> ReactiveSeq<R> |
forEach3(java.util.function.Function<? super T,? extends java.util.stream.BaseStream<R1,?>> stream1,
java.util.function.BiFunction<? super T,? super R1,? extends java.util.stream.BaseStream<R2,?>> stream2,
Fn3<? super T,? super R1,? super R2,java.lang.Boolean> filterFunction,
Fn3<? super T,? super R1,? super R2,? extends R> yieldingFunction)
Perform a three level nested internal iteration over this Stream and the
supplied streams
|
default <R1,R2,R3,R> |
forEach4(java.util.function.Function<? super T,? extends java.util.stream.BaseStream<R1,?>> stream1,
java.util.function.BiFunction<? super T,? super R1,? extends java.util.stream.BaseStream<R2,?>> stream2,
Fn3<? super T,? super R1,? super R2,? extends java.util.stream.BaseStream<R3,?>> stream3,
Fn4<? super T,? super R1,? super R2,? super R3,? extends R> yieldingFunction)
Perform a four level nested internal iteration over this Stream and the
supplied streams
|
default <R1,R2,R3,R> |
forEach4(java.util.function.Function<? super T,? extends java.util.stream.BaseStream<R1,?>> stream1,
java.util.function.BiFunction<? super T,? super R1,? extends java.util.stream.BaseStream<R2,?>> stream2,
Fn3<? super T,? super R1,? super R2,? extends java.util.stream.BaseStream<R3,?>> stream3,
Fn4<? super T,? super R1,? super R2,? super R3,java.lang.Boolean> filterFunction,
Fn4<? super T,? super R1,? super R2,? super R3,? extends R> yieldingFunction)
Perform a four level nested internal iteration over this Stream and the
supplied streams
|
java.lang.String |
format() |
static com.aol.cyclops2.internal.stream.OneShotStreamX<java.lang.Integer> |
fromCharSequence(java.lang.CharSequence input)
Construct a ReactiveSeq from a String
|
static ReactiveSeq<java.lang.Double> |
fromDoubleStream(java.util.stream.DoubleStream stream)
Construct a ReactiveSeq from a Stream
|
static ReactiveSeq<java.lang.Integer> |
fromIntStream(java.util.stream.IntStream stream)
Construct a ReactiveSeq from a Stream
|
static <T> ReactiveSeq<T> |
fromIterable(java.lang.Iterable<T> iterable)
Construct a ReactiveSeq from an Iterable
|
static <T> ReactiveSeq<T> |
fromIterator(java.util.Iterator<T> iterator)
Construct a ReactiveSeq from an Iterator
|
static <T> ReactiveSeq<T> |
fromList(java.util.List<T> list)
Construct a ReactiveSeq from a List (prefer this method if the source is a
list, as it allows more efficient Stream reversal).
|
static ReactiveSeq<java.lang.Long> |
fromLongStream(java.util.stream.LongStream stream)
Construct a ReactiveSeq from a Stream
|
static <T> ReactiveSeq<T> |
fromPublisher(org.reactivestreams.Publisher<? extends T> publisher)
Construct a ReactiveSeq from an Publisher
|
static <T> ReactiveSeq<T> |
fromSpliterator(com.aol.cyclops2.internal.stream.spliterators.push.PushingSpliterator<T> spliterator) |
static <T> ReactiveSeq<T> |
fromSpliterator(java.util.Spliterator<T> spliterator)
Construct a ReactiveSeq from the Supplied Spliterator
|
static <T> ReactiveSeq<T> |
fromStream(java.util.stream.Stream<T> stream)
Construct a ReactiveSeq from a Stream
|
default ReactiveStreamsTerminalFutureOperations<T> |
futureOperations(java.util.concurrent.Executor ex) |
static <T> ReactiveSeq<T> |
generate(java.util.function.Supplier<T> s) |
default java.util.Optional<T> |
get(long index)
Return the elementAt index or Optional.empty
|
default <K> MapX<K,ListX<T>> |
groupBy(java.util.function.Function<? super T,? extends K> classifier)
Use classifier function to group elements in this Sequence into a Map
|
default <K> ReactiveSeq<org.jooq.lambda.tuple.Tuple2<K,ReactiveSeq<T>>> |
grouped(java.util.function.Function<? super T,? extends K> classifier)
Group this Traversable by the provided classifying function and collected by the provided Collector
|
default <K,A,D> ReactiveSeq<org.jooq.lambda.tuple.Tuple2<K,D>> |
grouped(java.util.function.Function<? super T,? extends K> classifier,
java.util.stream.Collector<? super T,A,D> downstream)
Group this Traversable by the provided classifying function and collected by the provided Collector
|
ReactiveSeq<ListX<T>> |
grouped(int groupSize)
Group elements in a Stream
|
<C extends java.util.Collection<? super T>> |
grouped(int size,
java.util.function.Supplier<C> supplier)
Batch elements in a Stream by size into a collection created by the
supplied factory
|
ReactiveSeq<ListX<T>> |
groupedBySizeAndTime(int size,
long time,
java.util.concurrent.TimeUnit t)
Batch elements by size into a List
|
<C extends java.util.Collection<? super T>> |
groupedBySizeAndTime(int size,
long time,
java.util.concurrent.TimeUnit unit,
java.util.function.Supplier<C> factory)
Batch elements by size into a collection created by the supplied factory
|
<C extends java.util.Collection<? super T>,R> |
groupedBySizeAndTime(int size,
long time,
java.util.concurrent.TimeUnit unit,
java.util.function.Supplier<C> factory,
java.util.function.Function<? super C,? extends R> finalizer) |
ReactiveSeq<ListX<T>> |
groupedByTime(long time,
java.util.concurrent.TimeUnit t)
Batch elements in a Stream by time period
|
<C extends java.util.Collection<? super T>> |
groupedByTime(long time,
java.util.concurrent.TimeUnit unit,
java.util.function.Supplier<C> factory)
Batch elements by time into a collection created by the supplied factory
|
<C extends java.util.Collection<? super T>,R> |
groupedByTime(long time,
java.util.concurrent.TimeUnit unit,
java.util.function.Supplier<C> factory,
java.util.function.Function<? super C,? extends R> finalizer) |
<C extends java.util.Collection<T>,R> |
groupedStatefullyUntil(java.util.function.BiPredicate<C,? super T> predicate,
java.util.function.Supplier<C> factory,
java.util.function.Function<? super C,? extends R> finalizer) |
ReactiveSeq<ListX<T>> |
groupedStatefullyUntil(java.util.function.BiPredicate<ListX<? super T>,? super T> predicate)
Create ReactiveSeq of ListX where
each ListX is populated while the supplied bipredicate holds.
|
<C extends java.util.Collection<T>,R> |
groupedStatefullyWhile(java.util.function.BiPredicate<C,? super T> predicate,
java.util.function.Supplier<C> factory,
java.util.function.Function<? super C,? extends R> finalizer) |
ReactiveSeq<ListX<T>> |
groupedStatefullyWhile(java.util.function.BiPredicate<ListX<? super T>,? super T> predicate) |
ReactiveSeq<ListX<T>> |
groupedUntil(java.util.function.Predicate<? super T> predicate)
Create a ReactiveSeq batched by List, where each batch is populated until
the predicate holds
|
<C extends java.util.Collection<? super T>> |
groupedUntil(java.util.function.Predicate<? super T> predicate,
java.util.function.Supplier<C> factory)
Create a ReactiveSeq batched by a Collection, where each batch is populated
until the predicate holds
|
ReactiveSeq<ListX<T>> |
groupedWhile(java.util.function.Predicate<? super T> predicate)
Create a ReactiveSeq batched by List, where each batch is populated while
the predicate holds
|
<C extends java.util.Collection<? super T>> |
groupedWhile(java.util.function.Predicate<? super T> predicate,
java.util.function.Supplier<C> factory)
Create a ReactiveSeq batched by a Collection, where each batch is populated
while the predicate holds
|
HeadAndTail<T> |
headAndTail()
extract head and tail together, where head is expected to be present
Example :
|
HotStream<T> |
hotStream(java.util.concurrent.Executor e)
Turns this ReactiveSeq into a HotStream, a connectable Stream, being executed on a thread on the
supplied executor, that is producing data.
|
ReactiveSeq<T> |
insertAt(int pos,
T... values)
Insert data into a stream at given position
|
ReactiveSeq<T> |
insertAtS(int pos,
java.util.stream.Stream<T> stream)
Insert a Stream into the middle of this stream at the specified position
|
ReactiveSeq<T> |
intersperse(T value)
Returns a stream with a given value interspersed between any two values
of this stream.
|
default ReactiveSeq<java.lang.Integer> |
ints(java.util.function.ToIntFunction<? super T> fn,
java.util.function.Function<? super java.util.stream.IntStream,? extends java.util.stream.IntStream> mapper)
Peform intermediate operations on a primitive IntStream (gives improved performance when working with Integers)
If this ReactiveSeq has an OfInt Spliterator it will be converted directly to an IntStream,
otherwise the provided conversion function will be used.
|
default boolean |
isEmpty() |
static <T> ReactiveSeq<T> |
iterate(T seed,
java.util.function.UnaryOperator<T> f) |
ReactiveSeq<T> |
jitter(long maxJitterPeriodInNanos)
Introduce a random jitter / time delay between the emission of elements
|
java.lang.String |
join()
assertEquals("123".length(),ReactiveSeq.of(1, 2, 3).join().length());
|
java.lang.String |
join(java.lang.String sep)
assertEquals("1, 2, 3".length(), ReactiveSeq.of(1, 2, 3).join(", ").length());
|
java.lang.String |
join(java.lang.String sep,
java.lang.String start,
java.lang.String end)
assertEquals("^1|2|3$".length(), of(1, 2, 3).join("|", "^", "$").length());
|
default <R> ReactiveSeq<R> |
jooλ(java.util.function.Function<? super org.jooq.lambda.Seq<T>,? extends org.jooq.lambda.Seq<R>> mapper) |
ReactiveSeq<T> |
limit(long num)
assertThat(ReactiveSeq.of(4,3,6,7).limit(2).toList(),equalTo(Arrays.asList(4,3)); |
ReactiveSeq<T> |
limit(long time,
java.util.concurrent.TimeUnit unit)
Return all elements until specified time period has elapsed
|
static java.util.function.Function<? super ReactiveSeq<java.lang.Double>,? extends ReactiveSeq<java.lang.Double>> |
limitDouble(long maxSize) |
static java.util.function.Function<? super ReactiveSeq<java.lang.Integer>,? extends ReactiveSeq<java.lang.Integer>> |
limitInts(long maxSize) |
ReactiveSeq<T> |
limitLast(int num)
Limit results to the last x elements in a ReactiveSeq
|
static java.util.function.Function<? super ReactiveSeq<java.lang.Long>,? extends ReactiveSeq<java.lang.Long>> |
limitLongs(long maxSize) |
ReactiveSeq<T> |
limitUntil(java.util.function.Predicate<? super T> p)
Take elements from the Stream until the predicate returns true, after
which all elements are excluded.
|
default ReactiveSeq<T> |
limitUntilClosed(java.util.function.Predicate<? super T> p) |
ReactiveSeq<T> |
limitWhile(java.util.function.Predicate<? super T> p)
Take elements from the Stream while the predicate holds, once the
predicate returns false all subsequent elements are excluded
|
ReactiveSeq<T> |
limitWhileClosed(java.util.function.Predicate<? super T> predicate) |
default ReactiveSeq<java.lang.Long> |
longs(java.util.function.ToLongFunction<? super T> fn,
java.util.function.Function<? super java.util.stream.LongStream,? extends java.util.stream.LongStream> mapper)
Peform intermediate operations on a primitive IntStream (gives improved performance when working with Integers)
If this ReactiveSeq has an OfInt Spliterator it will be converted directly to an IntStream,
otherwise the provided conversion function will be used.
|
<R> ReactiveSeq<R> |
map(java.util.function.Function<? super T,? extends R> fn)
Transform this functor using the supplied transformation function
|
static java.util.function.Function<? super ReactiveSeq<java.lang.Double>,? extends ReactiveSeq<java.lang.Double>> |
mapDoubles(java.util.function.DoubleUnaryOperator b) |
static java.util.function.Function<? super ReactiveSeq<java.lang.Integer>,? extends ReactiveSeq<java.lang.Integer>> |
mapInts(java.util.function.IntUnaryOperator b) |
static java.util.function.Function<? super ReactiveSeq<java.lang.Long>,? extends ReactiveSeq<java.lang.Long>> |
mapLongs(java.util.function.LongUnaryOperator b) |
<R> R |
mapReduce(java.util.function.Function<? super T,? extends R> mapper,
Monoid<R> reducer)
Attempt to map this Monad to the same type as the supplied Monoid, using
supplied function Then use Monoid to reduce values
|
<R> R |
mapReduce(Reducer<R> reducer)
Attempt to map this Sequence to the same type as the supplied Monoid
(Reducer) Then use Monoid to reduce values
|
default java.util.stream.DoubleStream |
mapToDouble(java.util.function.ToDoubleFunction<? super T> fn) |
default java.util.stream.IntStream |
mapToInt(java.util.function.ToIntFunction<? super T> fn) |
default java.util.stream.LongStream |
mapToLong(java.util.function.ToLongFunction<? super T> fn) |
default java.util.Optional<T> |
max(java.util.Comparator<? super T> comparator) |
default java.util.Optional<T> |
min(java.util.Comparator<? super T> comparator) |
static <T> ReactiveSeq<T> |
narrowK(Higher<ReactiveSeq.µ,T> future)
Convert the raw Higher Kinded Type for ReactiveSeq types into the ReactiveSeq type definition class
|
boolean |
noneMatch(java.util.function.Predicate<? super T> c) |
default ReactiveSeq<T> |
notNull()
Filter elements retaining only values which are not null
|
static <T> ReactiveSeq<T> |
of(T... elements)
Create an efficiently reversable Sequence from the provided elements
|
static <T> ReactiveSeq<T> |
of(T value)
Efficiently construct a ReactiveSeq from a single value
|
static ReactiveSeq<java.lang.Double> |
ofDoubles(double... values) |
static ReactiveSeq<java.lang.Integer> |
ofInts(int... values) |
static ReactiveSeq<java.lang.Long> |
ofLongs(long... values) |
default <U> ReactiveSeq<U> |
ofType(java.lang.Class<? extends U> type)
Keep only those elements in a stream that are of a given type.
|
ReactiveSeq<T> |
onClose(java.lang.Runnable closeHandler) |
default ReactiveSeq<T> |
onEmpty(T value)
If this Container instance is empty, create a new instance containing the provided value
|
ReactiveSeq<T> |
onEmptyGet(java.util.function.Supplier<? extends T> supplier)
If this Container instance is empty, create a new instance containing the value returned from the provided Supplier
|
ReactiveSeq<T> |
onEmptySwitch(java.util.function.Supplier<? extends java.util.stream.Stream<T>> switchTo)
If this ReactiveSeq is empty replace it with a another Stream
|
<X extends java.lang.Throwable> |
onEmptyThrow(java.util.function.Supplier<? extends X> supplier)
If this container instance is empty, throw the exception returned by the provided Supplier
|
ReactiveSeq<T> |
onePer(long time,
java.util.concurrent.TimeUnit t)
emit one element per time period
|
static <T> ReactiveSeq<T> |
oneShotList(java.util.List<T> list) |
static <T> ReactiveSeq<T> |
oneShotStream(java.util.stream.Stream<T> stream) |
ReactiveSeq<T> |
parallel() |
default <R> ReactiveSeq<R> |
parallel(java.util.concurrent.ForkJoinPool fj,
java.util.function.Function<? super java.util.stream.Stream<T>,? extends java.util.stream.Stream<R>> fn) |
default <R> ReactiveSeq<R> |
parallel(java.util.function.Function<? super java.util.stream.Stream<T>,? extends java.util.stream.Stream<R>> fn) |
org.jooq.lambda.tuple.Tuple2<ReactiveSeq<T>,ReactiveSeq<T>> |
partition(java.util.function.Predicate<? super T> splitter)
Partition a Stream into two one a per element basis, based on predicate's
boolean value
|
PausableHotStream<T> |
pausableHotStream(java.util.concurrent.Executor e)
Turns this ReactiveSeq into a HotStream, a connectable & pausable Stream, being executed on a thread on the
supplied executor, that is producing data.
|
ReactiveSeq<T> |
peek(java.util.function.Consumer<? super T> c)
Peek at the current value of this Transformable, without transforming it
|
default ReactiveSeq<ReactiveSeq<T>> |
permutations()
Generate the permutations based on values in the ReactiveSeq Makes use of
Streamable to store intermediate stages in a collection
|
ReactiveSeq<T> |
prepend(java.lang.Iterable<? extends T> other) |
ReactiveSeq<T> |
prepend(T... values)
Prepend given values to the skip of the Stream
|
ReactiveSeq<T> |
prepend(T value) |
ReactiveSeq<T> |
prependS(java.util.stream.Stream<? extends T> stream)
Prepend Stream to this ReactiveSeq
|
HotStream<T> |
primedHotStream(java.util.concurrent.Executor e)
Return a HotStream that will skip emitting data when the first connecting Stream connects.
|
PausableHotStream<T> |
primedPausableHotStream(java.util.concurrent.Executor e)
Return a pausable HotStream that will skip emitting data when the first connecting Stream connects.
|
default void |
print(java.io.PrintStream stream)
Write each element within this Folds in turn to the supplied PrintStream
|
default void |
print(java.io.PrintWriter writer)
Write each element within this Folds in turn to the supplied PrintWriter
|
default void |
printErr()
Print each value in this Folds to the error console in turn (left-to-right)
|
default void |
printOut()
Print each value in this Folds to the console in turn (left-to-right)
|
static <T> ReactiveSubscriber<T> |
pushable() |
org.jooq.lambda.tuple.Tuple4<ReactiveSeq<T>,ReactiveSeq<T>,ReactiveSeq<T>,ReactiveSeq<T>> |
quadruplicate()
Makes four copies of a Stream Buffers intermediate values, leaders may
change positions so a limit can be safely applied to the leading stream.
|
static ReactiveSeq<java.lang.Integer> |
range(int start,
int end)
Create an efficiently reversable Sequence that produces the integers
between skip and take
|
static ReactiveSeq<java.lang.Long> |
rangeLong(long start,
long end)
Create an efficiently reversable Sequence that produces the integers
between skip and take
|
<EX extends java.lang.Throwable> |
recover(java.lang.Class<EX> exceptionClass,
java.util.function.Function<? super EX,? extends T> fn)
Recover from a particular exception type
|
ReactiveSeq<T> |
recover(java.util.function.Function<? super java.lang.Throwable,? extends T> fn)
Recover from an exception with an alternative value
|
java.util.Optional<T> |
reduce(java.util.function.BinaryOperator<T> accumulator)
An equivalent function to
Stream.reduce(BinaryOperator) |
ListX<T> |
reduce(java.lang.Iterable<? extends Monoid<T>> reducers)
Reduce with multiple reducers in parallel NB if this Monad is an Optional
[Arrays.asList(1,2,3)] reduce will operate on the Optional as if the list
was one value To reduce over the values on the list, called
streamedMonad() first.
|
T |
reduce(Monoid<T> reducer)
ReactiveSeq.of("hello","2","world","4").reduce(Reducers.toString(","));
//hello,2,world,4
|
ListX<T> |
reduce(java.util.stream.Stream<? extends Monoid<T>> reducers)
Reduce with multiple reducers in parallel NB if this Monad is an Optional
[Arrays.asList(1,2,3)] reduce will operate on the Optional as if the list
was one value To reduce over the values on the list, called
streamedMonad() first.
|
T |
reduce(T identity,
java.util.function.BinaryOperator<T> accumulator)
An equivalent function to
Stream.reduce(Object, BinaryOperator) |
<U> U |
reduce(U identity,
java.util.function.BiFunction<U,? super T,U> accumulator,
java.util.function.BinaryOperator<U> combiner)
An equivalent function to
Stream.reduce(Object, BiFunction, BinaryOperator) |
default ReactiveSeq<T> |
remove(T t)
Remove all occurances of the specified element from the ReactiveSeq
|
default ReactiveSeq<T> |
removeAllS(java.lang.Iterable<? extends T> it)
Remove all elements in the supplied Iterable from this filterable
|
default ReactiveSeq<T> |
removeAllS(java.util.stream.Stream<? extends T> stream)
Remove all elements in the supplied Stream from this filterable
|
default ReactiveSeq<T> |
removeAllS(T... values)
Remove all supplied elements from this filterable
|
default ReactiveSeq<T> |
retainAllS(java.lang.Iterable<? extends T> it)
Retain only the supplied elements in the returned Filters
|
default ReactiveSeq<T> |
retainAllS(java.util.stream.Stream<? extends T> stream)
Retain only the supplied elements in the returned Filters
|
default ReactiveSeq<T> |
retainAllS(T... values)
Retain only the supplied elements in the returned Filters
|
default <R> ReactiveSeq<R> |
retry(java.util.function.Function<? super T,? extends R> fn)
Retry a transformation if it fails.
|
default <R> ReactiveSeq<R> |
retry(java.util.function.Function<? super T,? extends R> fn,
int retries,
long delay,
java.util.concurrent.TimeUnit timeUnit)
Retry a transformation if it fails.
|
ReactiveSeq<T> |
reverse()
Potentially efficient Stream reversal.
|
static <T> ReactiveSeq<T> |
reversedListOf(java.util.List<T> elements)
Construct a Reveresed Sequence from the provided elements Can be reversed
(again) efficiently
|
static <T> ReactiveSeq<T> |
reversedOf(T... elements)
Construct a Reveresed Sequence from the provided elements Can be reversed
(again) efficiently
|
ReactiveSeq<T> |
scanLeft(Monoid<T> monoid)
Scan left using supplied Monoid
|
<U> ReactiveSeq<U> |
scanLeft(U seed,
java.util.function.BiFunction<? super U,? super T,? extends U> function)
Scan left
|
ReactiveSeq<T> |
scanRight(Monoid<T> monoid)
Scan right
|
<U> ReactiveSeq<U> |
scanRight(U identity,
java.util.function.BiFunction<? super T,? super U,? extends U> combiner)
Scan right
|
HotStream<T> |
schedule(java.lang.String cron,
java.util.concurrent.ScheduledExecutorService ex)
Execute this Stream on a schedule
|
HotStream<T> |
scheduleFixedDelay(long delay,
java.util.concurrent.ScheduledExecutorService ex)
Execute this Stream on a schedule
|
HotStream<T> |
scheduleFixedRate(long rate,
java.util.concurrent.ScheduledExecutorService ex)
Execute this Stream on a schedule
|
default org.jooq.lambda.Seq<T> |
seq() |
ReactiveSeq<T> |
sequential() |
ReactiveSeq<T> |
shuffle() |
ReactiveSeq<T> |
shuffle(java.util.Random random) |
default T |
single()
//1
ReactiveSeq.of(1).single();
//UnsupportedOperationException
ReactiveSeq.of().single();
//UnsupportedOperationException
ReactiveSeq.of(1,2,3).single();
|
default T |
single(java.util.function.Predicate<? super T> predicate) |
default java.util.Optional<T> |
singleOptional()
//Optional[1]
ReactiveSeq.of(1).singleOptional();
//Optional.empty
ReactiveSeq.of().singleOpional();
//Optional.empty
ReactiveSeq.of(1,2,3).singleOptional();
|
default int |
size()
[equivalent to count]
|
ReactiveSeq<T> |
skip(long num)
assertThat(ReactiveSeq.of(4,3,6,7).skip(2).toList(),equalTo(Arrays.asList(6,7))); |
ReactiveSeq<T> |
skip(long time,
java.util.concurrent.TimeUnit unit)
Skip all elements until specified time period has passed
|
static java.util.function.Function<? super ReactiveSeq<java.lang.Double>,? extends ReactiveSeq<java.lang.Double>> |
skipDoubles(long skip) |
static java.util.function.Function<? super ReactiveSeq<java.lang.Integer>,? extends ReactiveSeq<java.lang.Integer>> |
skipInts(long skip) |
ReactiveSeq<T> |
skipLast(int num)
assertThat(ReactiveSeq.of(1,2,3,4,5) .skipLast(2)
.collect(Collectors.toList()),equalTo(Arrays.asList(1,2,3)));
|
static java.util.function.Function<? super ReactiveSeq<java.lang.Long>,? extends ReactiveSeq<java.lang.Long>> |
skipLongs(long skip) |
ReactiveSeq<T> |
skipUntil(java.util.function.Predicate<? super T> p)
Drop elements from the Stream until the predicate returns true, after
which all elements are included
|
default ReactiveSeq<T> |
skipUntilClosed(java.util.function.Predicate<? super T> p) |
ReactiveSeq<T> |
skipWhile(java.util.function.Predicate<? super T> p)
SkipWhile drops elements from the Stream while the predicate holds, once
the predicte returns true all subsequent elements are included *
|
ReactiveSeq<T> |
skipWhileClosed(java.util.function.Predicate<? super T> predicate) |
ReactiveSeq<T> |
slice(long from,
long to) |
ReactiveSeq<PVectorX<T>> |
sliding(int windowSize)
Create a sliding view over this Sequence
|
ReactiveSeq<PVectorX<T>> |
sliding(int windowSize,
int increment)
Create a sliding view over this Sequence
|
ReactiveSeq<T> |
sorted()
assertThat(ReactiveSeq.of(4,3,6,7)).sorted().toList(),equalTo(Arrays.asList(3,4,6,7))); |
ReactiveSeq<T> |
sorted(java.util.Comparator<? super T> c)
assertThat(ReactiveSeq.of(4,3,6,7).sorted((a,b) -> b-a).toList(),equalTo(Arrays.asList(7,6,4,3)));
|
<U extends java.lang.Comparable<? super U>> |
sorted(java.util.function.Function<? super T,? extends U> function) |
<U> ReactiveSeq<T> |
sorted(java.util.function.Function<? super T,? extends U> function,
java.util.Comparator<? super U> comparator) |
org.jooq.lambda.tuple.Tuple2<ReactiveSeq<T>,ReactiveSeq<T>> |
splitAt(int where)
Split at supplied location
|
org.jooq.lambda.tuple.Tuple2<java.util.Optional<T>,ReactiveSeq<T>> |
splitAtHead()
Split a Stream at it's head (similar to headAndTail)
|
org.jooq.lambda.tuple.Tuple2<ReactiveSeq<T>,ReactiveSeq<T>> |
splitBy(java.util.function.Predicate<T> splitter)
Split stream at point where predicate no longer holds
|
java.util.Spliterator<T> |
spliterator()
Returns a spliterator for the elements of this stream.
|
boolean |
startsWith(java.util.stream.Stream<T> stream)
assertTrue(ReactiveSeq.of(1,2,3,4).startsWith(Stream.of(1,2,3))) |
boolean |
startsWithIterable(java.lang.Iterable<T> iterable)
assertTrue(ReactiveSeq.of(1,2,3,4).startsWith(Arrays.asList(1,2,3)));
|
ReactiveSeq<T> |
stream()
Convert this ReactiveSeq into a Stream
|
static <T> SeqSubscriber<T> |
subscriber()
Create a subscriber that can listen to Reactive Streams (simple-react,
RxJava AkkaStreams, Kontraktor, QuadarStreams etc)
|
default ReactiveSeq<T> |
subStream(int start,
int end)
Return a Stream with elements before the provided skip index removed,
and elements after the provided take index removed
|
default ReactiveSeq<T> |
take(long take)
assertThat(ReactiveSeq.of(4,3,6,7).take(2).toList(),equalTo(Arrays.asList(4,3)); |
default ReactiveSeq<T> |
takeRight(int num)
Generate a new Traversable that takes the specified number elements from the take of this Traversable
|
default ReactiveSeq<T> |
takeUntil(java.util.function.Predicate<? super T> p)
Generate a new Traversable that takes elements from this Traversable until the predicate holds
|
default ReactiveSeq<T> |
takeWhile(java.util.function.Predicate<? super T> p)
Generate a new Traversable that takes elements from this Traversable as long as the predicate holds
|
default ReactiveSeq<org.jooq.lambda.tuple.Tuple2<T,java.lang.Long>> |
timestamp()
ReactiveSeq.of(1,2,3,4,5)
.timestamp()
.forEach(System.out::println)
|
<C extends java.util.Collection<T>> |
toCollection(java.util.function.Supplier<C> collectionFactory) |
CollectionX<T> |
toConcurrentLazyCollection()
Lazily converts this ReactiveSeq into a Collection.
|
Streamable<T> |
toConcurrentLazyStreamable()
Streamable<Integer> repeat = ReactiveSeq.of(1, 2, 3, 4, 5, 6).map(i -> i + 2).toConcurrentLazyStreamable();
assertThat(repeat.stream().toList(), equalTo(Arrays.asList(2, 4, 6, 8, 10, 12)));
assertThat(repeat.stream().toList(), equalTo(Arrays.asList(2, 4, 6, 8, 10, 12)));
|
CollectionX<T> |
toLazyCollection()
Lazily converts this ReactiveSeq into a Collection.
|
java.util.List<T> |
toList() |
java.util.Set<T> |
toSet() |
<T> java.util.stream.Stream<T> |
toStream()
Convert this ReactiveSeq into a Stream
|
Streamable<T> |
toStreamable()
Streamable<Integer> repeat = ReactiveSeq.of(1,2,3,4,5,6)
.map(i->i*2)
.toStreamable();
repeat.stream().toList(); //Arrays.asList(2,4,6,8,10,12));
repeat.stream().toList() //Arrays.asList(2,4,6,8,10,12));
|
default <R> ReactiveSeq<R> |
trampoline(java.util.function.Function<? super T,? extends Trampoline<? extends R>> mapper)
Performs a map operation that can call a recursive method without running out of stack space
|
org.jooq.lambda.tuple.Tuple3<ReactiveSeq<T>,ReactiveSeq<T>,ReactiveSeq<T>> |
triplicate()
Triplicates a Stream Buffers intermediate values, leaders may change
positions so a limit can be safely applied to the leading stream.
|
static <U,T> ReactiveSeq<T> |
unfold(U seed,
java.util.function.Function<? super U,java.util.Optional<org.jooq.lambda.tuple.Tuple2<T,U>>> unfolder)
Unfold a function into a ReactiveSeq
|
<T> ReactiveSeq<T> |
unit(T unit) |
ReactiveSeq<T> |
unordered() |
<R> R |
unwrap()
Unwrap a wrapped value
|
static <T,U> org.jooq.lambda.tuple.Tuple2<ReactiveSeq<T>,ReactiveSeq<U>> |
unzip(ReactiveSeq<org.jooq.lambda.tuple.Tuple2<T,U>> sequence)
Unzip a zipped Stream
|
static <T1,T2,T3> org.jooq.lambda.tuple.Tuple3<ReactiveSeq<T1>,ReactiveSeq<T2>,ReactiveSeq<T3>> |
unzip3(ReactiveSeq<org.jooq.lambda.tuple.Tuple3<T1,T2,T3>> sequence)
Unzip a zipped Stream into 3
|
static <T1,T2,T3,T4> |
unzip4(ReactiveSeq<org.jooq.lambda.tuple.Tuple4<T1,T2,T3,T4>> sequence)
Unzip a zipped Stream into 4
|
boolean |
xMatch(int num,
java.util.function.Predicate<? super T> c)
Check that there are specified number of matches of predicate in the
Stream
|
ReactiveSeq<T> |
xPer(int x,
long time,
java.util.concurrent.TimeUnit t)
emit x elements per time period
|
default ReactiveSeq<T> |
zip(java.util.function.BinaryOperator<Zippable<T>> combiner,
Zippable<T> app)
Combine two applicatives together using the provided BinaryOperator (Semigroup, Monoid and Reducer all
extend BinaryOperator - checkout Semigroups and Monoids for a large number of canned combinations).
|
default <U> ReactiveSeq<org.jooq.lambda.tuple.Tuple2<T,U>> |
zip(java.lang.Iterable<? extends U> other)
Zip (combine) this Zippable with the supplied Iterable combining both into a Tuple2
|
default <U,R> ReactiveSeq<R> |
zip(java.lang.Iterable<? extends U> other,
java.util.function.BiFunction<? super T,? super U,? extends R> zipper)
Zip (combine) this Zippable with the supplied Iterable using the supplied combining function
|
<S,U> ReactiveSeq<org.jooq.lambda.tuple.Tuple3<T,S,U>> |
zip3(java.lang.Iterable<? extends S> second,
java.lang.Iterable<? extends U> third)
zip 3 Streams into one
|
default <S,U,R> ReactiveSeq<R> |
zip3(java.lang.Iterable<? extends S> second,
java.lang.Iterable<? extends U> third,
Fn3<? super T,? super S,? super U,? extends R> fn3) |
<T2,T3,T4> ReactiveSeq<org.jooq.lambda.tuple.Tuple4<T,T2,T3,T4>> |
zip4(java.lang.Iterable<? extends T2> second,
java.lang.Iterable<? extends T3> third,
java.lang.Iterable<? extends T4> fourth)
zip 4 Streams into 1
|
default <T2,T3,T4,R> |
zip4(java.lang.Iterable<? extends T2> second,
java.lang.Iterable<? extends T3> third,
java.lang.Iterable<? extends T4> fourth,
Fn4<? super T,? super T2,? super T3,? super T4,? extends R> fn) |
default <U> ReactiveSeq<org.jooq.lambda.tuple.Tuple2<T,U>> |
zipP(org.reactivestreams.Publisher<? extends U> other) |
default <U,R> ReactiveSeq<R> |
zipP(org.reactivestreams.Publisher<? extends U> other,
java.util.function.BiFunction<? super T,? super U,? extends R> zipper)
Zip (combine) this Zippable with the supplied Publisher, using the supplied combining function
|
<U> ReactiveSeq<org.jooq.lambda.tuple.Tuple2<T,U>> |
zipS(java.util.stream.Stream<? extends U> other)
Zip 2 streams into one
|
<U,R> ReactiveSeq<R> |
zipS(java.util.stream.Stream<? extends U> other,
java.util.function.BiFunction<? super T,? super U,? extends R> zipper)
Zip (combine) this Zippable with the supplied Stream, using the supplied combining function
|
default <R> ReactiveSeq<R> |
zipWith(java.lang.Iterable<java.util.function.Function<? super T,? extends R>> fn) |
default ReactiveSeq<org.jooq.lambda.tuple.Tuple2<T,java.lang.Long>> |
zipWithIndex()
Add an index to the current Stream
|
default <R> ReactiveSeq<R> |
zipWithP(org.reactivestreams.Publisher<java.util.function.Function<? super T,? extends R>> fn) |
default <R> ReactiveSeq<R> |
zipWithS(java.util.stream.Stream<java.util.function.Function<? super T,? extends R>> fn) |
builder, flatMapToDouble, flatMapToInt, flatMapToLong, forEachOrdered, toArray, toArray
apply, foldFuture, foldLazy, foldTry, forEach, forEach, forEach, forEach, forEach, runFuture, runLazy, visit
andThen, andThen, bind, compose, functionOps, lift, lift, liftF, liftOpt, liftTry, memoize, memoize, product, reader, λ, λv
apply, applyPartially, applyPartially, curry, curry, from, toFunction
avg, avgDouble, avgInt, avgLong, bitAnd, bitAndInt, bitAndLong, bitOr, bitOrInt, bitOrLong, collectable, commonPrefix, commonSuffix, count, countDistinct, countDistinct, countDistinctBy, countDistinctBy, max, max, max, maxAll, maxAll, maxAll, maxAll, maxAllBy, maxAllBy, maxBy, maxBy, median, median, medianBy, medianBy, min, min, min, minAll, minAll, minAll, minAll, minAllBy, minAllBy, minBy, minBy, mode, modeAll, modeAllBy, modeBy, percentile, percentile, percentileBy, percentileBy, sum, sumDouble, sumInt, sumLong, toList, toMap, toMap, toSet, toString, toString
foldLeft, foldLeft, foldLeft, foldLeft, reduce
toDequeX, toFutureStream, toFutureStream, toListX, toMapX, toOptional, toPBagX, toPMapX, toPOrderedSetX, toPQueueX, toPSetX, toPStackX, toPVectorX, toQueueX, toSetX, toSimpleReact, toSimpleReact, toSortedSetX, toValue
subscribe, traversable, unitIterator
futureStream, getStreamable, jdkStream, reactiveSeq, reveresedJDKStream, reveresedStream
groupedStatefullyUntilT, groupedT, groupedUntilT, groupedWhileT, slidingT, slidingT
<A,R> ReactiveSeq<R> collectSeq(java.util.stream.Collector<? super T,A,R> c)
ReactiveSeq<T> fold(Monoid<T> monoid)
static <T> ReactiveSubscriber<T> pushable()
static com.aol.cyclops2.internal.stream.OneShotStreamX<java.lang.Integer> fromCharSequence(java.lang.CharSequence input)
input
- String to construct ReactiveSeq fromstatic ReactiveSeq<java.lang.Integer> ofInts(int... values)
values
- ints to populate Stream fromstatic java.util.function.Function<? super ReactiveSeq<java.lang.Integer>,? extends ReactiveSeq<java.lang.Integer>> limitInts(long maxSize)
static java.util.function.Function<? super ReactiveSeq<java.lang.Integer>,? extends ReactiveSeq<java.lang.Integer>> skipInts(long skip)
static java.util.function.Function<? super ReactiveSeq<java.lang.Integer>,? extends ReactiveSeq<java.lang.Integer>> mapInts(java.util.function.IntUnaryOperator b)
static java.util.function.Function<? super ReactiveSeq<java.lang.Integer>,? extends ReactiveSeq<java.lang.Integer>> filterInts(java.util.function.IntPredicate b)
static java.util.function.Function<? super ReactiveSeq<java.lang.Integer>,? extends ReactiveSeq<java.lang.Integer>> flatMapInts(java.util.function.IntFunction<? extends java.util.stream.IntStream> b)
static java.util.function.Function<? super ReactiveSeq<java.lang.Integer>,? extends ReactiveSeq<java.lang.Integer>> concatInts(ReactiveSeq<java.lang.Integer> b)
static ReactiveSeq<java.lang.Long> ofLongs(long... values)
values
- longs to populate Stream fromstatic java.util.function.Function<? super ReactiveSeq<java.lang.Long>,? extends ReactiveSeq<java.lang.Long>> limitLongs(long maxSize)
static java.util.function.Function<? super ReactiveSeq<java.lang.Long>,? extends ReactiveSeq<java.lang.Long>> skipLongs(long skip)
static java.util.function.Function<? super ReactiveSeq<java.lang.Long>,? extends ReactiveSeq<java.lang.Long>> mapLongs(java.util.function.LongUnaryOperator b)
static java.util.function.Function<? super ReactiveSeq<java.lang.Long>,? extends ReactiveSeq<java.lang.Long>> filterLongs(java.util.function.LongPredicate b)
static java.util.function.Function<? super ReactiveSeq<java.lang.Long>,? extends ReactiveSeq<java.lang.Long>> flatMapLongs(java.util.function.LongFunction<? extends java.util.stream.LongStream> b)
static java.util.function.Function<? super ReactiveSeq<java.lang.Long>,? extends ReactiveSeq<java.lang.Long>> concatLongs(ReactiveSeq<java.lang.Long> b)
static ReactiveSeq<java.lang.Double> ofDoubles(double... values)
values
- longs to populate Stream fromstatic java.util.function.Function<? super ReactiveSeq<java.lang.Double>,? extends ReactiveSeq<java.lang.Double>> limitDouble(long maxSize)
static java.util.function.Function<? super ReactiveSeq<java.lang.Double>,? extends ReactiveSeq<java.lang.Double>> skipDoubles(long skip)
static java.util.function.Function<? super ReactiveSeq<java.lang.Double>,? extends ReactiveSeq<java.lang.Double>> mapDoubles(java.util.function.DoubleUnaryOperator b)
static java.util.function.Function<? super ReactiveSeq<java.lang.Double>,? extends ReactiveSeq<java.lang.Double>> filterLongs(java.util.function.DoublePredicate b)
static java.util.function.Function<? super ReactiveSeq<java.lang.Double>,? extends ReactiveSeq<java.lang.Double>> flatMapDoubles(java.util.function.DoubleFunction<? extends java.util.stream.DoubleStream> b)
static java.util.function.Function<? super ReactiveSeq<java.lang.Double>,? extends ReactiveSeq<java.lang.Double>> concatDoubles(ReactiveSeq<java.lang.Double> b)
static <T> ReactiveSeq<T> of(T value)
of
in interface java.util.stream.Stream<T>
value
- Value to construct ReactiveSeq fromstatic <T> ReactiveSeq<T> fromSpliterator(java.util.Spliterator<T> spliterator)
spliterator
- Spliterator to construct a Stream fromstatic <T> ReactiveSeq<T> fromSpliterator(com.aol.cyclops2.internal.stream.spliterators.push.PushingSpliterator<T> spliterator)
default ReactiveSeq<java.lang.Integer> ints(java.util.function.ToIntFunction<? super T> fn, java.util.function.Function<? super java.util.stream.IntStream,? extends java.util.stream.IntStream> mapper)
{@code ReactiveSeq.range(1, 1000) .ints(i->i,s->s.map(i->i*2).filter(i->i<500)) .size(), //249
fn
- mapper
- default <R> ReactiveSeq<R> jooλ(java.util.function.Function<? super org.jooq.lambda.Seq<T>,? extends org.jooq.lambda.Seq<R>> mapper)
default <R> R foldJooλ(java.util.function.Function<? super org.jooq.lambda.Seq<T>,? extends R> mapper)
default java.util.stream.IntStream mapToInt(java.util.function.ToIntFunction<? super T> fn)
mapToInt
in interface java.util.stream.Stream<T>
mapToInt
in interface Traversable<T>
default ReactiveSeq<java.lang.Long> longs(java.util.function.ToLongFunction<? super T> fn, java.util.function.Function<? super java.util.stream.LongStream,? extends java.util.stream.LongStream> mapper)
{@code ReactiveSeq.range(1, 1000) .longs(i->i.longValue(),s->s.map(i->i*2).filter(i->i<500)) .size(), //249
fn
- mapper
- default java.util.stream.LongStream mapToLong(java.util.function.ToLongFunction<? super T> fn)
mapToLong
in interface java.util.stream.Stream<T>
mapToLong
in interface Traversable<T>
default ReactiveSeq<java.lang.Double> doubles(java.util.function.ToDoubleFunction<? super T> fn, java.util.function.Function<? super java.util.stream.DoubleStream,? extends java.util.stream.DoubleStream> mapper)
{@code ReactiveSeq.range(1, 1000) .doubles(i->i.doubleValue(),s->s.map(i->i*2).filter(i->i<500)) .size(), //249
fn
- mapper
- default java.util.stream.DoubleStream mapToDouble(java.util.function.ToDoubleFunction<? super T> fn)
mapToDouble
in interface java.util.stream.Stream<T>
mapToDouble
in interface Traversable<T>
static <T> ReactiveSeq<T> fill(T t)
t
- Value to fill Stream withdefault <R> ReactiveSeq<R> coflatMap(java.util.function.Function<? super ReactiveSeq<T>,? extends R> fn)
ReactiveSeq.of(1,2,3)
.map(i->i*2)
.coflatMap(s -> s.reduce(0,(a,b)->a+b))
//ReactiveSeq[12]
fn
- <T> ReactiveSeq<T> unit(T unit)
default <R> ReactiveSeq<R> parallel(java.util.function.Function<? super java.util.stream.Stream<T>,? extends java.util.stream.Stream<R>> fn)
default <R> ReactiveSeq<R> parallel(java.util.concurrent.ForkJoinPool fj, java.util.function.Function<? super java.util.stream.Stream<T>,? extends java.util.stream.Stream<R>> fn)
default <R> R foldParallel(java.util.function.Function<? super java.util.stream.Stream<T>,? extends R> fn)
default <R> R foldParallel(java.util.concurrent.ForkJoinPool fj, java.util.function.Function<? super java.util.stream.Stream<T>,? extends R> fn)
<U> U foldRight(U identity, java.util.function.BiFunction<? super T,? super U,? extends U> accumulator)
Folds
default void printOut()
Folds
default <U,R> ReactiveSeq<R> zip(java.lang.Iterable<? extends U> other, java.util.function.BiFunction<? super T,? super U,? extends R> zipper)
Zippable
default <U,R> ReactiveSeq<R> zipP(org.reactivestreams.Publisher<? extends U> other, java.util.function.BiFunction<? super T,? super U,? extends R> zipper)
Zippable
<U,R> ReactiveSeq<R> zipS(java.util.stream.Stream<? extends U> other, java.util.function.BiFunction<? super T,? super U,? extends R> zipper)
Zippable
<R> R unwrap()
Unwrapable
unwrap
in interface Unwrapable
static <T1> ReactiveSeq<T1> flatten(ReactiveSeq<? extends ReactiveSeq<T1>> nested)
ReactiveSeq.of(Arrays.asList(1,2))
.to(ReactiveSeq::flatten));
//stream of (1, 2);
static <T1> ReactiveSeq<T1> flattenI(ReactiveSeq<? extends java.lang.Iterable<T1>> nested)
static <T1> ReactiveSeq<T1> flattenO(ReactiveSeq<? extends java.util.Optional<T1>> nested)
ReactiveSeq<T> cycle()
ReactiveSeq.of(1).cycle().limit(6).toList());
//List[1, 1, 1, 1, 1,1]
org.jooq.lambda.tuple.Tuple2<ReactiveSeq<T>,ReactiveSeq<T>> duplicate()
Tuple2<ReactiveSeq<Integer>, ReactiveSeq<Integer>> copies = of(1, 2, 3, 4, 5, 6)
.duplicate();
assertTrue(copies.v1.anyMatch(i > i == 2));
assertTrue(copies.v2.anyMatch(i > i == 2));
org.jooq.lambda.tuple.Tuple3<ReactiveSeq<T>,ReactiveSeq<T>,ReactiveSeq<T>> triplicate()
Tuple3<ReactiveSeq<Tuple3<T1, T2, T3>>, ReactiveSeq<Tuple3<T1, T2, T3>>, ReactiveSeq<Tuple3<T1, T2, T3>>> Tuple3 = sequence.triplicate();
org.jooq.lambda.tuple.Tuple4<ReactiveSeq<T>,ReactiveSeq<T>,ReactiveSeq<T>,ReactiveSeq<T>> quadruplicate()
Tuple4<ReactiveSeq<Tuple4<T1, T2, T3, T4>>,
ReactiveSeq<Tuple4<T1, T2, T3, T4>>,
ReactiveSeq<Tuple4<T1, T2, T3, T4>>,
ReactiveSeq<Tuple4<T1, T2, T3, T4>>> quad = sequence.quadruplicate();
org.jooq.lambda.tuple.Tuple2<java.util.Optional<T>,ReactiveSeq<T>> splitAtHead()
ReactiveSeq.of(1,2,3)
.splitAtHead()
//Optional[1], ReactiveSeq[2,3]
org.jooq.lambda.tuple.Tuple2<ReactiveSeq<T>,ReactiveSeq<T>> splitAt(int where)
ReactiveSeq.of(1,2,3)
.splitAt(1)
//ReactiveSeq[1], ReactiveSeq[2,3]
org.jooq.lambda.tuple.Tuple2<ReactiveSeq<T>,ReactiveSeq<T>> splitBy(java.util.function.Predicate<T> splitter)
ReactiveSeq.of(1, 2, 3, 4, 5, 6).splitBy(i->i<4)
//ReactiveSeq[1,2,3] ReactiveSeq[4,5,6]
org.jooq.lambda.tuple.Tuple2<ReactiveSeq<T>,ReactiveSeq<T>> partition(java.util.function.Predicate<? super T> splitter)
ReactiveSeq.of(1, 2, 3, 4, 5, 6).partition(i -> i % 2 != 0)
//ReactiveSeq[1,3,5], ReactiveSeq[2,4,6]
ReactiveSeq<T> cycle(Monoid<T> m, long times)
List<Integer> list = ReactiveSeq.of(1,2,2))
.cycle(Reducers.toCountInt(),3)
.collect(Collectors.toList());
//List[3,3,3];
cycle
in interface Traversable<T>
m
- Monoid to be used in reductiontimes
- Number of times value should be repeatedReactiveSeq<T> cycleWhile(java.util.function.Predicate<? super T> predicate)
MutableInt count = MutableInt.of(0);
ReactiveSeq.of(1, 2, 2).cycleWhile(next -> count++ < 6)
.collect(Collectors.toList());
// List(1,2,2,1,2,2)
cycleWhile
in interface Traversable<T>
predicate
- repeat while trueReactiveSeq<T> cycleUntil(java.util.function.Predicate<? super T> predicate)
MutableInt count =MutableInt.of(0);
ReactiveSeq.of(1,2,2)
.cycleUntil(next -> count.get()>6)
.peek(i-> count.mutate(i->i+1))
.collect(Collectors.toList());
//List[1,2,2,1,2,2,1]
cycleUntil
in interface Traversable<T>
predicate
- repeat while true<U> ReactiveSeq<org.jooq.lambda.tuple.Tuple2<T,U>> zipS(java.util.stream.Stream<? extends U> other)
List<Tuple2<Integer, String>> list = of(1, 2).zip(of("a", "b", "c", "d")).toList();
// [[1,"a"],[2,"b"]]
default <U> ReactiveSeq<org.jooq.lambda.tuple.Tuple2<T,U>> zip(java.lang.Iterable<? extends U> other)
Zippable
<S,U> ReactiveSeq<org.jooq.lambda.tuple.Tuple3<T,S,U>> zip3(java.lang.Iterable<? extends S> second, java.lang.Iterable<? extends U> third)
List<Tuple3<Integer, Integer, Character>> list = of(1, 2, 3, 4, 5, 6).zip3(of(100, 200, 300, 400), of('a', 'b', 'c')).collect(Collectors.toList());
// [[1,100,'a'],[2,200,'b'],[3,300,'c']]
<T2,T3,T4> ReactiveSeq<org.jooq.lambda.tuple.Tuple4<T,T2,T3,T4>> zip4(java.lang.Iterable<? extends T2> second, java.lang.Iterable<? extends T3> third, java.lang.Iterable<? extends T4> fourth)
List<Tuple4<Integer, Integer, Character, String>> list = of(1, 2, 3, 4, 5, 6).zip4(of(100, 200, 300, 400), of('a', 'b', 'c'), of("hello", "world"))
.collect(Collectors.toList());
// [[1,100,'a',"hello"],[2,200,'b',"world"]]
default org.jooq.lambda.Seq<T> seq()
seq
in interface ConvertableSequence<T>
seq
in interface FoldableTraversable<T>
default ReactiveSeq<org.jooq.lambda.tuple.Tuple2<T,java.lang.Long>> zipWithIndex()
assertEquals(asList(new Tuple2("a", 0L), new Tuple2("b", 1L)), of("a", "b").zipWithIndex().toList());
zipWithIndex
in interface Traversable<T>
ReactiveSeq<PVectorX<T>> sliding(int windowSize)
List<List<Integer>> list = ReactiveSeq.of(1, 2, 3, 4, 5, 6).sliding(2).collect(Collectors.toList());
assertThat(list.get(0), hasItems(1, 2));
assertThat(list.get(1), hasItems(2, 3));
sliding
in interface Traversable<T>
windowSize
- Size of sliding windowReactiveSeq<PVectorX<T>> sliding(int windowSize, int increment)
List<List<Integer>> list = ReactiveSeq.of(1, 2, 3, 4, 5, 6).sliding(3, 2).collect(Collectors.toList());
assertThat(list.get(0), hasItems(1, 2, 3));
assertThat(list.get(1), hasItems(3, 4, 5));
sliding
in interface Traversable<T>
windowSize
- number of elements in each batchincrement
- for each windowReactiveSeq<ListX<T>> grouped(int groupSize)
List<List<Integer>> list = ReactiveSeq.of(1, 2, 3, 4, 5, 6).grouped(3).collect(Collectors.toList());
assertThat(list.get(0), hasItems(1, 2, 3));
assertThat(list.get(1), hasItems(4, 5, 6));
grouped
in interface Traversable<T>
groupSize
- Size of each GroupReactiveSeq<ListX<T>> groupedStatefullyUntil(java.util.function.BiPredicate<ListX<? super T>,? super T> predicate)
ReactiveSeq.of(1,2,3,4,5,6)
.groupedStatefullyUntil((s,i)-> s.contains(4) ? true : false)
.toList()
.size()
//5
groupedStatefullyUntil
in interface Traversable<T>
predicate
- Window while true<C extends java.util.Collection<T>,R> ReactiveSeq<R> groupedStatefullyUntil(java.util.function.BiPredicate<C,? super T> predicate, java.util.function.Supplier<C> factory, java.util.function.Function<? super C,? extends R> finalizer)
ReactiveSeq<ListX<T>> groupedStatefullyWhile(java.util.function.BiPredicate<ListX<? super T>,? super T> predicate)
<C extends java.util.Collection<T>,R> ReactiveSeq<R> groupedStatefullyWhile(java.util.function.BiPredicate<C,? super T> predicate, java.util.function.Supplier<C> factory, java.util.function.Function<? super C,? extends R> finalizer)
ReactiveSeq<ListX<T>> groupedBySizeAndTime(int size, long time, java.util.concurrent.TimeUnit t)
ReactiveSeq.of(1,2,3,4,5,6)
.groupedBySizeAndTime(3,10,TimeUnit.SECONDS)
.toList();
//[[1,2,3],[4,5,6]]
size
- Max size of a batchtime
- (Max) time period to build a single batch int
- time unit for batch<C extends java.util.Collection<? super T>> ReactiveSeq<C> groupedBySizeAndTime(int size, long time, java.util.concurrent.TimeUnit unit, java.util.function.Supplier<C> factory)
ReactiveSeq.of(1,2,3,4,5,6)
.groupedBySizeAndTime(3,10,TimeUnit.SECONDS,()->SetX.empty())
.toList();
//[[1,2,3],[4,5,6]]
size
- Max size of a batchtime
- (Max) time period to build a single batch inunit
- time unit for batchfactory
- Collection factory<C extends java.util.Collection<? super T>,R> ReactiveSeq<R> groupedBySizeAndTime(int size, long time, java.util.concurrent.TimeUnit unit, java.util.function.Supplier<C> factory, java.util.function.Function<? super C,? extends R> finalizer)
<C extends java.util.Collection<? super T>,R> ReactiveSeq<R> groupedByTime(long time, java.util.concurrent.TimeUnit unit, java.util.function.Supplier<C> factory, java.util.function.Function<? super C,? extends R> finalizer)
ReactiveSeq<ListX<T>> groupedByTime(long time, java.util.concurrent.TimeUnit t)
assertThat(ReactiveSeq.of(1,2,3,4,5,6).batchByTime(1,TimeUnit.SECONDS).collect(Collectors.toList()).size(),is(1));
assertThat(ReactiveSeq.of(1,2,3,4,5,6).batchByTime(1,TimeUnit.NANOSECONDS).collect(Collectors.toList()).size(),greaterThan(5));
time
- - time period to build a single batch int
- time unit for batch<C extends java.util.Collection<? super T>> ReactiveSeq<C> groupedByTime(long time, java.util.concurrent.TimeUnit unit, java.util.function.Supplier<C> factory)
assertThat(ReactiveSeq.of(1,1,1,1,1,1)
.batchByTime(1500,TimeUnit.MICROSECONDS,()-> new TreeSet<>())
.toList()
.get(0)
.size(),is(1));
time
- - time period to build a single batch inunit
- time unit for batchfactory
- Collection factory<C extends java.util.Collection<? super T>> ReactiveSeq<C> grouped(int size, java.util.function.Supplier<C> supplier)
assertThat(ReactiveSeq.of(1,1,1,1,1,1)
.batchBySize(3,()->new TreeSet<>())
.toList()
.get(0)
.size(),is(1));
grouped
in interface Traversable<T>
size
- batch sizesupplier
- Collection factoryReactiveSeq<ListX<T>> groupedUntil(java.util.function.Predicate<? super T> predicate)
assertThat(ReactiveSeq.of(1,2,3,4,5,6)
.batchUntil(i->i%3==0)
.toList()
.size(),equalTo(2));
groupedUntil
in interface Traversable<T>
predicate
- Batch until predicate holds, transform open next batchReactiveSeq<ListX<T>> groupedWhile(java.util.function.Predicate<? super T> predicate)
assertThat(ReactiveSeq.of(1,2,3,4,5,6)
.batchWhile(i->i%3!=0)
.toList().size(),equalTo(2));
groupedWhile
in interface Traversable<T>
predicate
- Batch while predicate holds, transform open next batch<C extends java.util.Collection<? super T>> ReactiveSeq<C> groupedWhile(java.util.function.Predicate<? super T> predicate, java.util.function.Supplier<C> factory)
assertThat(ReactiveSeq.of(1,2,3,4,5,6)
.batchWhile(i->i%3!=0)
.toList()
.size(),equalTo(2));
groupedWhile
in interface Traversable<T>
predicate
- Batch while predicate holds, transform open next batchfactory
- Collection factory<C extends java.util.Collection<? super T>> ReactiveSeq<C> groupedUntil(java.util.function.Predicate<? super T> predicate, java.util.function.Supplier<C> factory)
assertThat(ReactiveSeq.of(1,2,3,4,5,6)
.batchUntil(i->i%3!=0)
.toList()
.size(),equalTo(2));
groupedUntil
in interface Traversable<T>
predicate
- Batch until predicate holds, transform open next batchfactory
- Collection factorydefault <K,A,D> ReactiveSeq<org.jooq.lambda.tuple.Tuple2<K,D>> grouped(java.util.function.Function<? super T,? extends K> classifier, java.util.stream.Collector<? super T,A,D> downstream)
Traversable
grouped
in interface Traversable<T>
classifier
- Grouping functiondownstream
- Collector to create the grouping collectiondefault <K> ReactiveSeq<org.jooq.lambda.tuple.Tuple2<K,ReactiveSeq<T>>> grouped(java.util.function.Function<? super T,? extends K> classifier)
Traversable
grouped
in interface Traversable<T>
classifier
- Grouping functiondefault <K> MapX<K,ListX<T>> groupBy(java.util.function.Function<? super T,? extends K> classifier)
Map<Integer, List<Integer>> map1 = of(1, 2, 3, 4).groupBy(i -> i % 2);
assertEquals(asList(2, 4), map1.get(0));
assertEquals(asList(1, 3), map1.get(1));
assertEquals(2, map1.size());
ReactiveSeq<T> distinct()
distinct
in interface java.util.stream.Stream<T>
distinct
in interface Traversable<T>
ReactiveSeq<T> scanLeft(Monoid<T> monoid)
assertEquals(asList("", "a", "ab", "abc"),ReactiveSeq.of("a", "b", "c")
.scanLeft(Reducers.toString("")).toList());
scanLeft
in interface Traversable<T>
monoid
- <U> ReactiveSeq<U> scanLeft(U seed, java.util.function.BiFunction<? super U,? super T,? extends U> function)
assertThat(of("a", "b", "c").scanLeft("", String::concat).toList().size(),
is(4));
scanLeft
in interface Traversable<T>
ReactiveSeq<T> scanRight(Monoid<T> monoid)
assertThat(of("a", "b", "c").scanRight(Monoid.of("", String::concat)).toList().size(),
is(asList("", "c", "bc", "abc").size()));
scanRight
in interface Traversable<T>
<U> ReactiveSeq<U> scanRight(U identity, java.util.function.BiFunction<? super T,? super U,? extends U> combiner)
assertThat(of("a", "ab", "abc").map(str->str.length()).scanRight(0, (t, u) -> u + t).toList().size(),
is(asList(0, 3, 5, 6).size()));
scanRight
in interface Traversable<T>
ReactiveSeq<T> sorted()
assertThat(ReactiveSeq.of(4,3,6,7)).sorted().toList(),equalTo(Arrays.asList(3,4,6,7)));
sorted
in interface java.util.stream.Stream<T>
sorted
in interface Traversable<T>
default ReactiveSeq<T> combine(java.util.function.BiPredicate<? super T,? super T> predicate, java.util.function.BinaryOperator<T> op)
Traversable
ReactiveSeq.of(1,1,2,3)
.combine((a, b)->a.equals(b),Semigroups.intSum)
.toListX()
//ListX(3,4)
combine
in interface Traversable<T>
predicate
- Test to see if two neighbours should be joinedop
- Reducer to combine neighboursReactiveSeq<T> sorted(java.util.Comparator<? super T> c)
assertThat(ReactiveSeq.of(4,3,6,7).sorted((a,b) -> b-a).toList(),equalTo(Arrays.asList(7,6,4,3)));
sorted
in interface java.util.stream.Stream<T>
sorted
in interface Traversable<T>
c
- Compartor to sort withdefault ReactiveSeq<T> takeWhile(java.util.function.Predicate<? super T> p)
Traversable
ListX.of(1,2,3).takeWhile(i<3);
//[1,2]
takeWhile
in interface Traversable<T>
p
- Predicate to determine when values should be takendefault ReactiveSeq<T> drop(long drop)
Traversable
assertThat(ReactiveSeq.of(4,3,6,7).drop(2).toList(),equalTo(Arrays.asList(6,7)));
drop
in interface Traversable<T>
drop
- Number of elemenets to dropdefault ReactiveSeq<T> take(long take)
Traversable
assertThat(ReactiveSeq.of(4,3,6,7).take(2).toList(),equalTo(Arrays.asList(4,3));
take
in interface Traversable<T>
take
- Limit element size to numdefault ReactiveSeq<T> dropWhile(java.util.function.Predicate<? super T> p)
Traversable
ListX.of(1,2,3).dropWhile(i<3);
//[3]
dropWhile
in interface Traversable<T>
p
- Predicate to determine when values should be droppeddefault ReactiveSeq<T> takeUntil(java.util.function.Predicate<? super T> p)
Traversable
ListX.of(1,2,3).takeUntil(i<2);
//[1,2]
takeUntil
in interface Traversable<T>
p
- Predicate to determine when values should be taken untildefault ReactiveSeq<T> dropUntil(java.util.function.Predicate<? super T> p)
Traversable
ListX.of(1,2,3).dropUntil(i>2);
//[3]
dropUntil
in interface Traversable<T>
p
- Predicate to determine when values should be droppeddefault ReactiveSeq<T> dropRight(int num)
Traversable
ListX.of(1,2,3).dropRight(2);
//[1]
dropRight
in interface Traversable<T>
num
- Drop this number of elements from the take of this Traversabledefault ReactiveSeq<T> takeRight(int num)
Traversable
ListX.of(1,2,3).takeRight(2);
//[2,3]
takeRight
in interface Traversable<T>
num
- Take this number of elements from the take of this TraversableReactiveSeq<T> skip(long num)
assertThat(ReactiveSeq.of(4,3,6,7).skip(2).toList(),equalTo(Arrays.asList(6,7)));
skip
in interface java.util.stream.Stream<T>
skip
in interface Traversable<T>
num
- Number of elemenets to skipvoid forEach(java.util.function.Consumer<? super T> action)
This is a terminal operation.
The behavior of this operation is explicitly nondeterministic. For parallel stream pipelines, this operation does not guarantee to respect the encounter order of the stream, as doing so would sacrifice the benefit of parallelism. For any given element, the action may be performed at whatever time and in whatever thread the library chooses. If the action accesses shared state, it is responsible for providing the required synchronization.
forEach
in interface java.lang.Iterable<T>
forEach
in interface java.util.stream.Stream<T>
action
- a
non-interfering action to perform on the elementsReactiveSeq<T> skipWhile(java.util.function.Predicate<? super T> p)
assertThat(ReactiveSeq.of(4,3,6,7).sorted().skipWhile(i->i<6).toList(),equalTo(Arrays.asList(6,7)));
skipWhile
in interface Traversable<T>
p
- Predicate to skip while trueReactiveSeq<T> skipUntil(java.util.function.Predicate<? super T> p)
assertThat(ReactiveSeq.of(4,3,6,7).skipUntil(i->i==6).toList(),equalTo(Arrays.asList(6,7)));
skipUntil
in interface Traversable<T>
p
- Predicate to skip until truedefault ReactiveSeq<T> skipUntilClosed(java.util.function.Predicate<? super T> p)
ReactiveSeq<T> limit(long num)
assertThat(ReactiveSeq.of(4,3,6,7).limit(2).toList(),equalTo(Arrays.asList(4,3));
limit
in interface java.util.stream.Stream<T>
limit
in interface Traversable<T>
num
- Limit element size to numReactiveSeq<T> limitWhile(java.util.function.Predicate<? super T> p)
assertThat(ReactiveSeq.of(4,3,6,7).sorted().limitWhile(i->i<6).toList(),equalTo(Arrays.asList(3,4)));
limitWhile
in interface Traversable<T>
p
- Limit while predicate is trueReactiveSeq<T> limitUntil(java.util.function.Predicate<? super T> p)
assertThat(ReactiveSeq.of(4,3,6,7).limitUntil(i->i==6).toList(),equalTo(Arrays.asList(4,3)));
limitUntil
in interface Traversable<T>
p
- Limit until predicate is truedefault ReactiveSeq<T> limitUntilClosed(java.util.function.Predicate<? super T> p)
ReactiveSeq<T> parallel()
boolean allMatch(java.util.function.Predicate<? super T> c)
assertThat(ReactiveSeq.of(1,2,3,4,5).allMatch(it-> it>0 && it <6),equalTo(true));
allMatch
in interface CyclopsCollectable<T>
allMatch
in interface java.util.stream.Stream<T>
c
- Predicate to check if all matchboolean anyMatch(java.util.function.Predicate<? super T> c)
assertThat(ReactiveSeq.of(1,2,3,4,5).anyMatch(it-> it.equals(3)),equalTo(true));
anyMatch
in interface CyclopsCollectable<T>
anyMatch
in interface java.util.stream.Stream<T>
c
- Predicate to check if any matchboolean xMatch(int num, java.util.function.Predicate<? super T> c)
assertTrue(ReactiveSeq.of(1,2,3,5,6,7).xMatch(3, i-> i>4 ));
boolean noneMatch(java.util.function.Predicate<? super T> c)
noneMatch
in interface CyclopsCollectable<T>
noneMatch
in interface java.util.stream.Stream<T>
java.lang.String join()
assertEquals("123".length(),ReactiveSeq.of(1, 2, 3).join().length());
java.lang.String join(java.lang.String sep)
assertEquals("1, 2, 3".length(), ReactiveSeq.of(1, 2, 3).join(", ").length());
java.lang.String join(java.lang.String sep, java.lang.String start, java.lang.String end)
assertEquals("^1|2|3$".length(), of(1, 2, 3).join("|", "^", "$").length());
HeadAndTail<T> headAndTail()
FoldableTraversable
ReactiveSeq<String> helloWorld = ReactiveSeq.Of("hello","world","last");
HeadAndTail<String> headAndTail = helloWorld.headAndTail();
String head = headAndTail.head();
//head == "hello"
ReactiveSeq<String> tail = headAndTail.tail();
//["world","last]
headAndTail
in interface FoldableTraversable<T>
java.util.Optional<T> findFirst()
java.util.Optional<T> findAny()
default <R> ReactiveSeq<R> trampoline(java.util.function.Function<? super T,? extends Trampoline<? extends R>> mapper)
ReactiveSeq.of(10,20,30,40)
.trampoline(i-> fibonacci(i))
.forEach(System.out::println);
Trampoline<Long> fibonacci(int i){
return fibonacci(i,1,0);
}
Trampoline<Long> fibonacci(int n, long a, long b) {
return n == 0 ? Trampoline.done(b) : Trampoline.more( ()->fibonacci(n-1, a+b, a));
}
55
6765
832040
102334155
ReactiveSeq.of(10_000,200_000,3_000_000,40_000_000)
.trampoline(i-> fibonacci(i))
.forEach(System.out::println);
completes successfully
trampoline
in interface Transformable<T>
mapper
- <R> R mapReduce(Reducer<R> reducer)
ReactiveSeq.of("hello","2","world","4").mapReduce(Reducers.toCountInt());
//4
<R> R mapReduce(java.util.function.Function<? super T,? extends R> mapper, Monoid<R> reducer)
ReactiveSeq.of("one","two","three","four")
.mapReduce(this::toInt,Reducers.toTotalInt());
//10
int toInt(String s){
if("one".equals(s))
return 1;
if("two".equals(s))
return 2;
if("three".equals(s))
return 3;
if("four".equals(s))
return 4;
return -1;
}
T reduce(Monoid<T> reducer)
ReactiveSeq.of("hello","2","world","4").reduce(Reducers.toString(","));
//hello,2,world,4
java.util.Optional<T> reduce(java.util.function.BinaryOperator<T> accumulator)
Folds
Stream.reduce(BinaryOperator)
ReactiveSeq.of(1,2,3,4,5).map(it -> it*100).reduce(
(acc,next) -> acc+next)
//Optional[1500]
T reduce(T identity, java.util.function.BinaryOperator<T> accumulator)
Folds
Stream.reduce(Object, BinaryOperator)
<U> U reduce(U identity, java.util.function.BiFunction<U,? super T,U> accumulator, java.util.function.BinaryOperator<U> combiner)
Folds
Stream.reduce(Object, BiFunction, BinaryOperator)
default <R> R collect(java.util.function.Supplier<R> supplier, java.util.function.BiConsumer<R,? super T> accumulator, java.util.function.BiConsumer<R,R> combiner)
ArrayList
, and elements are incorporated by updating
the state of the result rather than by replacing the result. This
produces a result equivalent to:
R result = supplier.get();
for (T element : this stream)
accumulator.accept(result, element);
return result;
Like reduce(Object, BinaryOperator)
, collect
operations
can be parallelized without requiring additional synchronization.
This is a terminal operation.
collect
in interface java.util.stream.Stream<T>
supplier
- a function that creates a new result container. For a
parallel execution, this function may be called
multiple times and must return a fresh value each time.accumulator
- an associative,
non-interfering,
stateless
function for incorporating an additional element into a resultcombiner
- an associative,
non-interfering,
stateless
function for combining two values, which must be
compatible with the accumulator functiondefault <R,A> R collect(java.util.stream.Collector<? super T,A,R> collector)
Collector
. A Collector
encapsulates the function used as arguments to
collect(Supplier, BiConsumer, BiConsumer)
, allowing for reuse of
collection strategies and composition of collect operations such as
multiple-level grouping or partitioning.
If the stream is parallel, and the Collector
is concurrent
, and
either the stream is unordered or the collector is
unordered
,
transform a concurrent reduction will be performed (see Collector
for
details on concurrent reduction.)
This is a terminal operation.
When executed in parallel, multiple intermediate results may be
instantiated, populated, and merged so as to maintain isolation of
mutable data structures. Therefore, even when executed in parallel
with non-thread-safe data structures (such as ArrayList
), no
additional synchronization is needed for a parallel reduction.
collect
in interface CyclopsCollectable<T>
collect
in interface java.util.stream.Stream<T>
collector
- the Collector
describing the reductioncollect(Supplier, BiConsumer, BiConsumer)
,
Collectors
ListX<T> reduce(java.util.stream.Stream<? extends Monoid<T>> reducers)
Monoid<Integer> sum = Monoid.of(0, (a, b) -> a + b);
Monoid<Integer> mult = Monoid.of(1, (a, b) -> a * b);
List<Integer> result = ReactiveSeq.of(1, 2, 3, 4).reduce(Arrays.asList(sum, mult).stream());
assertThat(result, equalTo(Arrays.asList(10, 24)));
ListX<T> reduce(java.lang.Iterable<? extends Monoid<T>> reducers)
Monoid<Integer> sum = Monoid.of(0,(a,b)->a+b);
Monoid<Integer> mult = Monoid.of(1,(a,b)->a*b);
List<Integer> result = ReactiveSeq.of(1,2,3,4))
.reduce(Arrays.asList(sum,mult) );
assertThat(result,equalTo(Arrays.asList(10,24)));
T foldRight(Monoid<T> reducer)
ReactiveSeq.of("a","b","c").foldRight(Reducers.toString(""));
// "cab"
T foldRight(T identity, java.util.function.BinaryOperator<T> accumulator)
assertTrue(ReactiveSeq.of("a","b","c").foldRight("", String::concat).equals("cba"));
<T> T foldRightMapToType(Reducer<T> reducer)
ReactiveSeq.of(1,2,3).foldRightMapToType(Reducers.toString(""));
// "321"
foldRightMapToType
in interface Folds<T>
reducer
- Monoid to reduce valuesStreamable<T> toStreamable()
Streamable<Integer> repeat = ReactiveSeq.of(1,2,3,4,5,6)
.map(i->i*2)
.toStreamable();
repeat.stream().toList(); //Arrays.asList(2,4,6,8,10,12));
repeat.stream().toList() //Arrays.asList(2,4,6,8,10,12));
toStreamable
in interface ConvertableSequence<T>
java.util.Set<T> toSet()
toSet
in interface CyclopsCollectable<T>
java.util.List<T> toList()
toList
in interface CyclopsCollectable<T>
<C extends java.util.Collection<T>> C toCollection(java.util.function.Supplier<C> collectionFactory)
toCollection
in interface CyclopsCollectable<T>
<T> java.util.stream.Stream<T> toStream()
ReactiveSeq<T> stream()
stream
in interface ConvertableSequence<T>
stream
in interface ExtendedTraversable<T>
stream
in interface FoldableTraversable<T>
stream
in interface Sequential<T>
stream
in interface ToStream<T>
stream
in interface TransformerTraversable<T>
stream
in interface Traversable<T>
boolean startsWithIterable(java.lang.Iterable<T> iterable)
assertTrue(ReactiveSeq.of(1,2,3,4).startsWith(Arrays.asList(1,2,3)));
startsWithIterable
in interface Folds<T>
iterable
- boolean startsWith(java.util.stream.Stream<T> stream)
assertTrue(ReactiveSeq.of(1,2,3,4).startsWith(Stream.of(1,2,3)))
startsWith
in interface Folds<T>
stream
- AnyMSeq<Witness.reactiveSeq,T> anyM()
<R> ReactiveSeq<R> map(java.util.function.Function<? super T,? extends R> fn)
Transformable
of(1,2,3).map(i->i*2)
//[2,4,6]
map
in interface FilterableTransformable<T>
map
in interface java.util.stream.Stream<T>
map
in interface Transformable<T>
fn
- Transformation functionReactiveSeq<T> peek(java.util.function.Consumer<? super T> c)
Transformable
of(1,2,3).map(System.out::println)
1
2
3
peek
in interface java.util.stream.Stream<T>
peek
in interface Transformable<T>
c
- Consumer that recieves each element from this Transformable<R> ReactiveSeq<R> flatMap(java.util.function.Function<? super T,? extends java.util.stream.Stream<? extends R>> fn)
assertThat(ReactiveSeq.of(1,2)
.flatMap(i -> asList(i, -i).stream())
.toList(),equalTo(asList(1, -1, 2, -2)));
flatMap
in interface java.util.stream.Stream<T>
fn
- to be applied<R> ReactiveSeq<R> flatMapAnyM(java.util.function.Function<? super T,AnyM<Witness.stream,? extends R>> fn)
assertThat(ReactiveSeq.of(1,2,3)).flatMapAnyM(i-> fromEither5(CompletableFuture.completedFuture(i+2))).toList(),equalTo(Arrays.asList(3,4,5)));
fn
- to be applied<R> ReactiveSeq<R> flatMapI(java.util.function.Function<? super T,? extends java.lang.Iterable<? extends R>> fn)
ReactiveSeq.of(1,2)
.flatMap(i -> asList(i, -i))
.toList();
//1,-1,2,-2
fn
- <R> ReactiveSeq<R> flatMapP(java.util.function.Function<? super T,? extends org.reactivestreams.Publisher<? extends R>> fn)
<R> ReactiveSeq<R> flatMapStream(java.util.function.Function<? super T,java.util.stream.BaseStream<? extends R,?>> fn)
assertThat(ReactiveSeq.of(1,2,3)
.flatMapStream(i->IntStream.of(i))
.toList(),equalTo(Arrays.asList(1,2,3)));
fn
- to be appliedReactiveSeq<T> filter(java.util.function.Predicate<? super T> fn)
Filters
of(1,2,3).filter(i->i>2);
//[3]
java.util.Spliterator<T> spliterator()
This is a terminal operation.
ReactiveSeq<T> sequential()
ReactiveSeq<T> unordered()
ReactiveSeq<T> intersperse(T value)
intersperse
in interface Traversable<T>
default <U> ReactiveSeq<U> ofType(java.lang.Class<? extends U> type)
default <U> ReactiveSeq<U> cast(java.lang.Class<? extends U> type)
ClassCastException
.
// ClassCastException ReactiveSeq.of(1, "a", 2, "b", 3).cast(Integer.class)cast
in interface Transformable<T>
CollectionX<T> toLazyCollection()
Collection<Integer> col = ReactiveSeq.of(1, 2, 3, 4, 5)
.peek(System.out::println)
.toLazyCollection();
col.forEach(System.out::println);
// Will print out "first!" before anything else
toLazyCollection
in interface Folds<T>
CollectionX<T> toConcurrentLazyCollection()
Collection<Integer> col = ReactiveSeq.of(1, 2, 3, 4, 5).peek(System.out::println).toConcurrentLazyCollection();
col.forEach(System.out::println);
// Will print out "first!" before anything else
toConcurrentLazyCollection
in interface Folds<T>
Streamable<T> toConcurrentLazyStreamable()
Streamable<Integer> repeat = ReactiveSeq.of(1, 2, 3, 4, 5, 6).map(i -> i + 2).toConcurrentLazyStreamable();
assertThat(repeat.stream().toList(), equalTo(Arrays.asList(2, 4, 6, 8, 10, 12)));
assertThat(repeat.stream().toList(), equalTo(Arrays.asList(2, 4, 6, 8, 10, 12)));
toConcurrentLazyStreamable
in interface Folds<T>
ReactiveSeq<T> reverse()
Traversable
assertThat( of(1, 2, 3).reverse().toList(),
equalTo(asList(3, 2, 1)));
reverse
in interface Traversable<T>
ReactiveSeq<T> onClose(java.lang.Runnable closeHandler)
ReactiveSeq<T> shuffle()
shuffle
in interface Traversable<T>
ReactiveSeq<T> prependS(java.util.stream.Stream<? extends T> stream)
List<String> result = ReactiveSeq.of(1, 2, 3)
.prependS(of(100, 200, 300))
.map(it -> it + "!!")
.collect(Collectors.toList());
assertThat(result, equalTo(Arrays.asList("100!!", "200!!", "300!!", "1!!", "2!!", "3!!")));
prependS
in interface Traversable<T>
stream
- to PrependReactiveSeq<T> append(T... values)
List<String> result = ReactiveSeq.of(1, 2, 3).append(100, 200, 300).map(it -> it + "!!").collect(Collectors.toList());
assertThat(result, equalTo(Arrays.asList("1!!", "2!!", "3!!", "100!!", "200!!", "300!!"))); *
append
in interface Traversable<T>
values
- to appendReactiveSeq<T> append(T value)
append
in interface Traversable<T>
ReactiveSeq<T> prepend(T value)
prepend
in interface Traversable<T>
ReactiveSeq<T> prepend(T... values)
List<String> result = ReactiveSeq.of(1,2,3)
.prepend(100,200,300)
.map(it ->it+"!!")
.collect(Collectors.toList());
assertThat(result,equalTo(Arrays.asList("100!!","200!!","300!!","1!!","2!!","3!!")));
prepend
in interface Traversable<T>
values
- to prependReactiveSeq<T> insertAt(int pos, T... values)
List<String> result = ReactiveSeq.of(1, 2, 3).insertAt(1, 100, 200, 300).map(it -> it + "!!").collect(Collectors.toList());
assertThat(result, equalTo(Arrays.asList("1!!", "100!!", "200!!", "300!!", "2!!", "3!!"))); *
insertAt
in interface Traversable<T>
pos
- to insert data atvalues
- to insertReactiveSeq<T> deleteBetween(int start, int end)
List<String> result = ReactiveSeq.of(1, 2, 3, 4, 5, 6).deleteBetween(2, 4).map(it -> it + "!!").collect(Collectors.toList());
assertThat(result, equalTo(Arrays.asList("1!!", "2!!", "5!!", "6!!"))); *
deleteBetween
in interface Traversable<T>
start
- indexend
- indexReactiveSeq<T> insertAtS(int pos, java.util.stream.Stream<T> stream)
List<String> result = ReactiveSeq.of(1, 2, 3).insertAtS(1, of(100, 200, 300)).map(it -> it + "!!").collect(Collectors.toList());
assertThat(result, equalTo(Arrays.asList("1!!", "100!!", "200!!", "300!!", "2!!", "3!!")));
insertAtS
in interface Traversable<T>
pos
- to insert Stream atstream
- to insertboolean endsWithIterable(java.lang.Iterable<T> iterable)
assertTrue(ReactiveSeq.of(1,2,3,4,5,6)
.endsWith(Arrays.asList(5,6)));
endsWithIterable
in interface Folds<T>
iterable
- Values to checkboolean endsWith(java.util.stream.Stream<T> stream)
assertTrue(ReactiveSeq.of(1,2,3,4,5,6)
.endsWith(Stream.of(5,6)));
ReactiveSeq<T> skip(long time, java.util.concurrent.TimeUnit unit)
List<Integer> result = ReactiveSeq.of(1, 2, 3, 4, 5, 6).peek(i -> sleep(i * 100)).skip(1000, TimeUnit.MILLISECONDS).toList();
// [4,5,6]
time
- Length of timeunit
- Time unitReactiveSeq<T> limit(long time, java.util.concurrent.TimeUnit unit)
List<Integer> result = ReactiveSeq.of(1, 2, 3, 4, 5, 6).peek(i -> sleep(i * 100)).limit(1000, TimeUnit.MILLISECONDS).toList();
// [1,2,3,4]
time
- Length of timeunit
- Time unitReactiveSeq<T> skipLast(int num)
skipLast
in interface Traversable<T>
num
- ReactiveSeq<T> limitLast(int num)
assertThat(ReactiveSeq.of(1,2,3,4,5)
.limitLast(2)
.collect(Collectors.toList()),equalTo(Arrays.asList(4,5)));
limitLast
in interface Traversable<T>
num
- of elements to return (last elements)HotStream<T> hotStream(java.util.concurrent.Executor e)
primedHotStream(Executor)
.
The generated HotStream is not pausable, for a pausable HotStream @see pausableHotStream(Executor)
.
Turns this ReactiveSeq into a HotStream, a connectable Stream, being
executed on a thread on the supplied executor, that is producing data
HotStream<Integer> ints = ReactiveSeq.range(0,Integer.MAX_VALUE)
.hotStream(exec)
ints.connect().forEach(System.out::println);
//print out all the ints
//multiple consumers are possible, so other Streams can connect on different Threads
e
- Executor to execute this ReactiveSeq onHotStream<T> primedHotStream(java.util.concurrent.Executor e)
hotStream(Executor)
.
The generated HotStream is not pausable, for a pausable HotStream @see primedPausableHotStream(Executor)
.
HotStream<Integer> ints = ReactiveSeq.range(0,Integer.MAX_VALUE) .hotStream(exec) ints.connect().forEach(System.out::println); //print out all the ints - starting when connect is called. //multiple consumers are possible, so other Streams can connect on different Threads
e
- PausableHotStream<T> pausableHotStream(java.util.concurrent.Executor e)
primedPausableHotStream(Executor)
.
The generated HotStream is pausable, for a unpausable HotStream (slightly faster execution) @see hotStream(Executor)
.
HotStream<Integer> ints = ReactiveSeq.range(0,Integer.MAX_VALUE)
.hotStream(exec)
ints.connect().forEach(System.out::println);
ints.pause(); //on a separate thread pause the generating Stream
//print out all the ints
//multiple consumers are possible, so other Streams can connect on different Threads
e
- Executor to execute this ReactiveSeq onPausableHotStream<T> primedPausableHotStream(java.util.concurrent.Executor e)
pausableHotStream(Executor)
.
The generated HotStream is pausable, for a unpausable HotStream @see primedHotStream(Executor)
.
HotStream<Integer> ints = ReactiveSeq.range(0,Integer.MAX_VALUE) .hotStream(exec) ints.connect().forEach(System.out::println); //print out all the ints - starting when connect is called. //multiple consumers are possible, so other Streams can connect on different Threads
e
- T firstValue()
assertThat(ReactiveSeq.of(1,2,3,4)
.map(u->{throw new RuntimeException();})
.recover(e->"hello")
.firstValue(),equalTo("hello"));
firstValue
in interface Folds<T>
default T single()
//1
ReactiveSeq.of(1).single();
//UnsupportedOperationException
ReactiveSeq.of().single();
//UnsupportedOperationException
ReactiveSeq.of(1,2,3).single();
default java.util.Optional<T> singleOptional()
//Optional[1]
ReactiveSeq.of(1).singleOptional();
//Optional.empty
ReactiveSeq.of().singleOpional();
//Optional.empty
ReactiveSeq.of(1,2,3).singleOptional();
singleOptional
in interface Folds<T>
default java.util.Optional<T> get(long index)
assertThat(ReactiveSeq.of(1,2,3,4,5).elementAt(2).get(),equalTo(3));
default org.jooq.lambda.tuple.Tuple2<T,ReactiveSeq<T>> elementAt(long index)
ReactiveSeq.of(1,2,3,4,5).get(2).v1
//3
index
- to extract element fromdefault ReactiveSeq<org.jooq.lambda.tuple.Tuple2<T,java.lang.Long>> elapsed()
ReactiveSeq.of(1,2,3,4,5)
.elapsed()
.forEach(System.out::println);
default ReactiveSeq<org.jooq.lambda.tuple.Tuple2<T,java.lang.Long>> timestamp()
ReactiveSeq.of(1,2,3,4,5)
.timestamp()
.forEach(System.out::println)
static <T> SeqSubscriber<T> subscriber()
SeqSubscriber<Integer> sub = ReactiveSeq.subscriber();
ReactiveSeq.of(1,2,3).subscribe(sub);
sub.stream().forEach(System.out::println);
1
2
3
static <T> ReactiveSeq<T> empty()
empty
in interface java.util.stream.Stream<T>
@SafeVarargs static <T> ReactiveSeq<T> of(T... elements)
of
in interface java.util.stream.Stream<T>
elements
- To Construct sequence from@SafeVarargs static <T> ReactiveSeq<T> reversedOf(T... elements)
elements
- To Construct sequence fromstatic <T> ReactiveSeq<T> reversedListOf(java.util.List<T> elements)
elements
- To Construct sequence fromstatic ReactiveSeq<java.lang.Integer> range(int start, int end)
start
- Number of range to skip fromend
- Number for range to take atstatic ReactiveSeq<java.lang.Long> rangeLong(long start, long end)
start
- Number of range to skip fromend
- Number for range to take atstatic <T> ReactiveSeq<T> fromStream(java.util.stream.Stream<T> stream)
stream
- Stream to construct Sequence fromstatic <T> ReactiveSeq<T> oneShotStream(java.util.stream.Stream<T> stream)
static ReactiveSeq<java.lang.Integer> fromIntStream(java.util.stream.IntStream stream)
stream
- Stream to construct Sequence fromstatic ReactiveSeq<java.lang.Long> fromLongStream(java.util.stream.LongStream stream)
stream
- Stream to construct Sequence fromstatic ReactiveSeq<java.lang.Double> fromDoubleStream(java.util.stream.DoubleStream stream)
stream
- Stream to construct Sequence fromstatic <T> ReactiveSeq<T> fromList(java.util.List<T> list)
list
- to construct Sequence fromstatic <T> ReactiveSeq<T> oneShotList(java.util.List<T> list)
static <T> ReactiveSeq<T> fromPublisher(org.reactivestreams.Publisher<? extends T> publisher)
publisher
- to construct ReactiveSeq fromstatic <T> ReactiveSeq<T> fromIterable(java.lang.Iterable<T> iterable)
iterable
- to construct Sequence fromstatic <T> ReactiveSeq<T> fromIterator(java.util.Iterator<T> iterator)
iterator
- to construct Sequence fromstatic <T> ReactiveSeq<T> iterate(T seed, java.util.function.UnaryOperator<T> f)
iterate
in interface java.util.stream.Stream<T>
Stream.iterate(Object, UnaryOperator)
static <T> ReactiveSeq<T> deferedI(java.util.function.Supplier<? extends java.lang.Iterable<? extends T>> lazy)
static <T> ReactiveSeq<T> deferedP(java.util.function.Supplier<? extends org.reactivestreams.Publisher<? extends T>> lazy)
static <T> ReactiveSeq<T> defered(java.util.function.Supplier<? extends java.util.stream.Stream<? extends T>> lazy)
static <U,T> ReactiveSeq<T> unfold(U seed, java.util.function.Function<? super U,java.util.Optional<org.jooq.lambda.tuple.Tuple2<T,U>>> unfolder)
ReactiveSeq.unfold(1,i->i<=6 ? Optional.of(Tuple.tuple(i,i+1)) : Optional.empty());
//(1,2,3,4,5)
seed
- Initial valueunfolder
- Iteratively applied function, terminated by an empty Optionalstatic <T> ReactiveSeq<T> generate(java.util.function.Supplier<T> s)
generate
in interface java.util.stream.Stream<T>
Stream.generate(Supplier)
static <T,U> org.jooq.lambda.tuple.Tuple2<ReactiveSeq<T>,ReactiveSeq<U>> unzip(ReactiveSeq<org.jooq.lambda.tuple.Tuple2<T,U>> sequence)
unzip(ReactiveSeq.of(new Tuple2(1, "a"), new Tuple2(2, "b"), new Tuple2(3, "c")))
// ReactiveSeq[1,2,3], ReactiveSeq[a,b,c]
static <T1,T2,T3> org.jooq.lambda.tuple.Tuple3<ReactiveSeq<T1>,ReactiveSeq<T2>,ReactiveSeq<T3>> unzip3(ReactiveSeq<org.jooq.lambda.tuple.Tuple3<T1,T2,T3>> sequence)
unzip3(ReactiveSeq.of(new Tuple3(1, "a", 2l), new Tuple3(2, "b", 3l), new Tuple3(3,"c", 4l)))
// ReactiveSeq[1,2,3], ReactiveSeq[a,b,c], ReactiveSeq[2l,3l,4l]
static <T1,T2,T3,T4> org.jooq.lambda.tuple.Tuple4<ReactiveSeq<T1>,ReactiveSeq<T2>,ReactiveSeq<T3>,ReactiveSeq<T4>> unzip4(ReactiveSeq<org.jooq.lambda.tuple.Tuple4<T1,T2,T3,T4>> sequence)
unzip4(ReactiveSeq.of(new Tuple4(1, "a", 2l,'µ'), new Tuple4(2, "b", 3l,'y'), new Tuple4(3,
"c", 4l,'x')));
// ReactiveSeq[1,2,3], ReactiveSeq[a,b,c], ReactiveSeq[2l,3l,4l], ReactiveSeq[µ,y,x]
ReactiveSeq<T> onEmptySwitch(java.util.function.Supplier<? extends java.util.stream.Stream<T>> switchTo)
assertThat(ReactiveSeq.of(4,5,6)
.onEmptySwitch(()->ReactiveSeq.of(1,2,3))
.toList(),
equalTo(Arrays.asList(4,5,6)));
onEmptySwitch
in interface OnEmptySwitch<T,java.util.stream.Stream<T>>
switchTo
- Supplier that will generate the alternative Streamdefault ReactiveSeq<T> onEmpty(T value)
OnEmpty
ReactiveSeq<T> onEmptyGet(java.util.function.Supplier<? extends T> supplier)
OnEmpty
onEmptyGet
in interface OnEmpty<T>
onEmptyGet
in interface Traversable<T>
supplier
- to determine new value for container<X extends java.lang.Throwable> ReactiveSeq<T> onEmptyThrow(java.util.function.Supplier<? extends X> supplier)
OnEmpty
onEmptyThrow
in interface OnEmpty<T>
onEmptyThrow
in interface Traversable<T>
supplier
- to create exception from<U> ReactiveSeq<T> distinct(java.util.function.Function<? super T,? extends U> keyExtractor)
ReactiveSeq<T> shuffle(java.util.Random random)
shuffle
in interface Traversable<T>
ReactiveSeq<T> slice(long from, long to)
slice
in interface Traversable<T>
<U extends java.lang.Comparable<? super U>> ReactiveSeq<T> sorted(java.util.function.Function<? super T,? extends U> function)
sorted
in interface Traversable<T>
ReactiveSeq<T> xPer(int x, long time, java.util.concurrent.TimeUnit t)
code
SimpleTimer timer = new SimpleTimer();
ReactiveSeq.of(1, 2, 3, 4, 5, 6)
.xPer(6, 100000000, TimeUnit.NANOSECONDS)
.collect(Collectors.toList())
.size();
//6
xPer
in interface Sequential<T>
x
- number of elements to emittime
- periodt
- Time unitReactiveSeq<T> onePer(long time, java.util.concurrent.TimeUnit t)
ReactiveSeq.iterate("", last -> "next")
.limit(100)
.batchBySize(10)
.onePer(1, TimeUnit.MICROSECONDS)
.peek(batch -> System.out.println("batched : " + batch))
.flatMap(Collection::stream)
.peek(individual -> System.out.println("Flattened : "
+ individual))
.forEach(a->{});
onePer
in interface Sequential<T>
time
- periodt
- Time unitReactiveSeq<T> debounce(long time, java.util.concurrent.TimeUnit t)
ReactiveSeq.of(1,2,3,4,5,6)
.debounce(1000,TimeUnit.SECONDS).toList();
// 1
time
- Time to apply debouncing overt
- Time unit for debounce periodReactiveSeq<T> fixedDelay(long l, java.util.concurrent.TimeUnit unit)
SimpleTimer timer = new SimpleTimer();
ReactiveSeq.of(1, 2, 3, 4, 5, 6)
.fixedDelay(10000, TimeUnit.NANOSECONDS)
.collect(Collectors.toList())
.size();
//6
assertThat(timer.getElapsedNanoseconds(), greaterThan(60000l));
fixedDelay
in interface Sequential<T>
l
- time length in nanos of the delayunit
- for the delayReactiveSeq<T> jitter(long maxJitterPeriodInNanos)
{ @code SimpleTimer timer = new SimpleTimer(); ReactiveSeq.of(1, 2, 3, 4, 5, 6) .jitter(10000) .collect(Collectors.toList()); assertThat(timer.getElapsedNanoseconds(), greaterThan(20000l)); }
maxJitterPeriodInNanos
- - random number less than this is used for each jitterReactiveSeq<T> recover(java.util.function.Function<? super java.lang.Throwable,? extends T> fn)
assertThat(ReactiveSeq.of(1,2,3,4)
.map(i->i+2)
.map(u->{throw new RuntimeException();})
.recover(e->"hello")
.firstValue(),equalTo("hello"));
recover
in interface Traversable<T>
fn
- Function that accepts a Throwable and returns an alternative
value<EX extends java.lang.Throwable> ReactiveSeq<T> recover(java.lang.Class<EX> exceptionClass, java.util.function.Function<? super EX,? extends T> fn)
assertThat(ReactiveSeq.of(1,2,3,4)
.map(i->i+2)
.map(u->{ExceptionSoftener.throwSoftenedException( new IOException()); return null;})
.recover(IOException.class,e->"hello")
.firstValue(),equalTo("hello"));
recover
in interface Traversable<T>
exceptionClass
- Type to recover fromfn
- That accepts an error and returns an alternative valuedefault <R> ReactiveSeq<R> retry(java.util.function.Function<? super T,? extends R> fn)
given(serviceMock.apply(anyInt())).willThrow(
new RuntimeException(new SocketException("First")),
new RuntimeException(new IOException("Second"))).willReturn(
"42");
String result = ReactiveSeq.of( 1, 2, 3)
.retry(serviceMock)
.firstValue();
//result = 42
retry
in interface Transformable<T>
fn
- Function to retry if failsdefault <R> ReactiveSeq<R> retry(java.util.function.Function<? super T,? extends R> fn, int retries, long delay, java.util.concurrent.TimeUnit timeUnit)
given(serviceMock.apply(anyInt())).willThrow(
new RuntimeException(new SocketException("First")),
new RuntimeException(new IOException("Second"))).willReturn(
"42");
String result = ReactiveSeq.of( 1, 2, 3)
.retry(serviceMock, 7, 2, TimeUnit.SECONDS)
.firstValue();
//result = 42
retry
in interface Transformable<T>
fn
- Function to retry if failsretries
- Number of retriesdelay
- Delay in TimeUnitstimeUnit
- TimeUnit to use for delaydefault ReactiveSeq<T> remove(T t)
ReactiveSeq.of(1,2,3,4,5,1,2,3).remove(1)
//Streamable[2,3,4,5,2,3]
t
- element to removedefault ReactiveSeq<ReactiveSeq<T>> permutations()
permutations
in interface ExtendedTraversable<T>
default ReactiveSeq<T> subStream(int start, int end)
ReactiveSeq.of(1,2,3,4,5,6).subStream(1,3);
//ReactiveSeq[2,3]
start
- index inclusiveend
- index exclusivedefault ReactiveSeq<ReactiveSeq<T>> combinations(int size)
ReactiveSeq.of(1,2,3).combinations(2)
//ReactiveSeq[ReactiveSeq[1,2],ReactiveSeq[1,3],ReactiveSeq[2,3]]
combinations
in interface ExtendedTraversable<T>
size
- of combinationsdefault ReactiveSeq<ReactiveSeq<T>> combinations()
ReactiveSeq.of(1,2,3).combinations()
//ReactiveSeq[ReactiveSeq[],ReactiveSeq[1],ReactiveSeq[2],ReactiveSeq[3].ReactiveSeq[1,2],ReactiveSeq[1,3],ReactiveSeq[2,3]
,ReactiveSeq[1,2,3]]
combinations
in interface ExtendedTraversable<T>
HotStream<T> schedule(java.lang.String cron, java.util.concurrent.ScheduledExecutorService ex)
//run at 8PM every night
ReactiveSeq.generate(()->"next job:"+formatDate(new Date()))
.map(this::processJob)
.schedule("0 20 * * *",Executors.newScheduledThreadPool(1));
Connect to the Scheduled Stream
HotStream<Data> dataStream = ReactiveSeq.generate(() -> "next job:" + formatDate(new Date())).map(this::processJob)
.schedule("0 20 * * *", Executors.newScheduledThreadPool(1));
data.connect().forEach(this::logToDB);
HotStream<T> scheduleFixedDelay(long delay, java.util.concurrent.ScheduledExecutorService ex)
//run every 60 seconds after last job completes
ReactiveSeq.generate(()->"next job:"+formatDate(new Date()))
.map(this::processJob)
.scheduleFixedDelay(60_000,Executors.newScheduledThreadPool(1));
Connect to the Scheduled Stream
HotStream<Data> dataStream = ReactiveSeq.generate(() -> "next job:" + formatDate(new Date())).map(this::processJob)
.scheduleFixedDelay(60_000, Executors.newScheduledThreadPool(1));
data.connect().forEach(this::logToDB);
scheduleFixedDelay
in interface Folds<T>
delay
- Between last element completes passing through the Stream
until the next one startsex
- ScheduledExecutorServiceHotStream<T> scheduleFixedRate(long rate, java.util.concurrent.ScheduledExecutorService ex)
//run every 60 seconds
ReactiveSeq.generate(()->"next job:"+formatDate(new Date()))
.map(this::processJob)
.scheduleFixedRate(60_000,Executors.newScheduledThreadPool(1));
Connect to the Scheduled Stream
HotStream<Data> dataStream = ReactiveSeq.generate(() -> "next job:" + formatDate(new Date())).map(this::processJob)
.scheduleFixedRate(60_000, Executors.newScheduledThreadPool(1));
data.connect().forEach(this::logToDB);
scheduleFixedRate
in interface Folds<T>
rate
- Time in millis between job runsex
- ScheduledExecutorServicedefault int size()
default <R1,R2,R3,R> ReactiveSeq<R> forEach4(java.util.function.Function<? super T,? extends java.util.stream.BaseStream<R1,?>> stream1, java.util.function.BiFunction<? super T,? super R1,? extends java.util.stream.BaseStream<R2,?>> stream2, Fn3<? super T,? super R1,? super R2,? extends java.util.stream.BaseStream<R3,?>> stream3, Fn4<? super T,? super R1,? super R2,? super R3,? extends R> yieldingFunction)
//ReactiveSeq [1,2]
reactiveSeq.forEach4(a->ListX.range(10,13),
(a,b)->ListX.of(""+(a+b),"hello world"),
(a,b,c)->ListX.of(a,b,c)),
(a,b,c,d)->c+":"a+":"+b);
stream1
- Nested Stream to iterate overstream2
- Nested Stream to iterate overstream3
- Nested Stream to iterate overyieldingFunction
- Function with pointers to the current element from both
Streams that generates the new elementsdefault <R1,R2,R3,R> ReactiveSeq<R> forEach4(java.util.function.Function<? super T,? extends java.util.stream.BaseStream<R1,?>> stream1, java.util.function.BiFunction<? super T,? super R1,? extends java.util.stream.BaseStream<R2,?>> stream2, Fn3<? super T,? super R1,? super R2,? extends java.util.stream.BaseStream<R3,?>> stream3, Fn4<? super T,? super R1,? super R2,? super R3,java.lang.Boolean> filterFunction, Fn4<? super T,? super R1,? super R2,? super R3,? extends R> yieldingFunction)
//ReactiveSeq [1,2,3]
seq.forEach4(a->ReactiveSeq.range(10,13),
(a,b)->Stream.of(""+(a+b),"hello world"),
(a,b,c)->Stream.of(a,b,c),
(a,b,c,d)-> c!=3,
(a,b,c)->c+":"a+":"+b);
stream1
- Nested Stream to iterate overstream2
- Nested Stream to iterate overstream3
- 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 elementsdefault <R1,R2,R> ReactiveSeq<R> forEach3(java.util.function.Function<? super T,? extends java.util.stream.BaseStream<R1,?>> stream1, java.util.function.BiFunction<? super T,? super R1,? extends java.util.stream.BaseStream<R2,?>> stream2, Fn3<? super T,? super R1,? super R2,? extends R> yieldingFunction)
ReactiveSeq.of(1,2)
.forEach3(a->IntStream.range(10,13),
(a,b)->Stream.of(""+(a+b),"hello world"),
(a,b,c)->c+":"a+":"+b);
//ReactiveSeq[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]
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 elementsdefault <R1,R2,R> ReactiveSeq<R> forEach3(java.util.function.Function<? super T,? extends java.util.stream.BaseStream<R1,?>> stream1, java.util.function.BiFunction<? super T,? super R1,? extends java.util.stream.BaseStream<R2,?>> stream2, Fn3<? super T,? super R1,? super R2,java.lang.Boolean> filterFunction, Fn3<? super T,? super R1,? super R2,? extends R> yieldingFunction)
ReactiveSeq.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);
//ReactiveSeq[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]
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 elementsdefault <R1,R> ReactiveSeq<R> forEach2(java.util.function.Function<? super T,? extends java.util.stream.BaseStream<R1,?>> stream1, java.util.function.BiFunction<? super T,? super R1,? extends R> yieldingFunction)
ReactiveSeq.of(1,2,3)
.forEach2(a->IntStream.range(10,13),
(a,b)->a+b);
//ReactiveSeq[11,14,12,15,13,16]
stream1
- Nested Stream to iterate overyieldingFunction
- Function with pointers to the current element from both
Streams that generates the new elementsdefault <R1,R> ReactiveSeq<R> forEach2(java.util.function.Function<? super T,? extends java.util.stream.BaseStream<R1,?>> stream1, java.util.function.BiFunction<? super T,? super R1,java.lang.Boolean> filterFunction, java.util.function.BiFunction<? super T,? super R1,? extends R> yieldingFunction)
ReactiveSeq.of(1,2,3)
.forEach2(a->IntStream.range(10,13),
(a,b)-> a<3 && b>10,
(a,b)->a+b);
//ReactiveSeq[14,15]
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 elementsdefault java.util.Optional<T> max(java.util.Comparator<? super T> comparator)
max
in interface CyclopsCollectable<T>
max
in interface java.util.stream.Stream<T>
long count()
return mapToLong(e -> 1L).sum();
This is a terminal operation.
count
in interface CyclopsCollectable<T>
count
in interface java.util.stream.Stream<T>
default java.util.Optional<T> min(java.util.Comparator<? super T> comparator)
min
in interface CyclopsCollectable<T>
min
in interface java.util.stream.Stream<T>
default void printErr()
Folds
default void print(java.io.PrintWriter writer)
Folds
default void print(java.io.PrintStream stream)
Folds
ReactiveSeq<T> appendS(java.util.stream.Stream<? extends T> other)
List<String> result = ReactiveSeq.of(1, 2, 3).appendStream(ReactiveSeq.of(100, 200, 300)).map(it -> it + "!!").collect(Collectors.toList());
assertThat(result, equalTo(Arrays.asList("1!!", "2!!", "3!!", "100!!", "200!!", "300!!"))); *
stream
- to appendReactiveSeq<T> append(java.lang.Iterable<? extends T> other)
ReactiveSeq<T> prepend(java.lang.Iterable<? extends T> other)
ReactiveSeq<T> cycle(long times)
ReactiveSeq.of(1,2,2)
.cycle(3)
.collect(Collectors.toList());
//List[1,2,2,1,2,2,1,2,2]
cycle
in interface Traversable<T>
times
- Times values should be repeated within a StreamReactiveSeq<T> skipWhileClosed(java.util.function.Predicate<? super T> predicate)
ReactiveSeq<T> limitWhileClosed(java.util.function.Predicate<? super T> predicate)
<U> ReactiveSeq<T> sorted(java.util.function.Function<? super T,? extends U> function, java.util.Comparator<? super U> comparator)
java.lang.String format()
default ReactiveSeq<T> removeAllS(java.util.stream.Stream<? extends T> stream)
IterableFilterable
removeAllS
in interface IterableFilterable<T>
stream
- of elements to removedefault ReactiveSeq<T> removeAllS(java.lang.Iterable<? extends T> it)
IterableFilterable
removeAllS
in interface IterableFilterable<T>
it
- an Iterable of elements to removedefault ReactiveSeq<T> removeAllS(T... values)
IterableFilterable
removeAllS
in interface IterableFilterable<T>
values
- to removedefault ReactiveSeq<T> retainAllS(java.lang.Iterable<? extends T> it)
IterableFilterable
retainAllS
in interface IterableFilterable<T>
it
- Iterable of elements to retaindefault ReactiveSeq<T> retainAllS(java.util.stream.Stream<? extends T> stream)
IterableFilterable
retainAllS
in interface IterableFilterable<T>
stream
- of elements to retaindefault ReactiveSeq<T> retainAllS(T... values)
IterableFilterable
retainAllS
in interface IterableFilterable<T>
values
- elements to retaindefault ReactiveSeq<T> filterNot(java.util.function.Predicate<? super T> predicate)
Filters
of(1,2,3).filter(i->i>2);
//[1,2]
default ReactiveSeq<T> notNull()
Filters
of(1,2,null,4).nonNull();
//[1,2,4]
default ReactiveStreamsTerminalFutureOperations<T> futureOperations(java.util.concurrent.Executor ex)
default boolean isEmpty()
default ReactiveSeq<T> zip(java.util.function.BinaryOperator<Zippable<T>> combiner, Zippable<T> app)
Zippable
zip
in interface Zippable<T>
Semigroup
,
Semigroups
,
Monoid
,
To lift any Semigroup (or monoid) up to handling Applicatives use the combineApplicatives operator in Semigroups
{@see com.aol.cyclops2.Semigroups#combineApplicatives(BiFunction) } or Monoids
{ {@see com.aol.cyclops2.Monoids#combineApplicatives(java.util.function.Function, com.aol.cyclops2.function.Monoid)
}
{@code
BinaryOperator> sumMaybes = Semigroups.combineScalarFunctors(Semigroups.intSum);
Maybe.just(1).zip(sumMaybes, Maybe.just(5))
//Maybe.just(6));
}
default <R> ReactiveSeq<R> zipWith(java.lang.Iterable<java.util.function.Function<? super T,? extends R>> fn)
default <R> ReactiveSeq<R> zipWithS(java.util.stream.Stream<java.util.function.Function<? super T,? extends R>> fn)
default <R> ReactiveSeq<R> zipWithP(org.reactivestreams.Publisher<java.util.function.Function<? super T,? extends R>> fn)
default <U> ReactiveSeq<org.jooq.lambda.tuple.Tuple2<T,U>> zipP(org.reactivestreams.Publisher<? extends U> other)
default <S,U,R> ReactiveSeq<R> zip3(java.lang.Iterable<? extends S> second, java.lang.Iterable<? extends U> third, Fn3<? super T,? super S,? super U,? extends R> fn3)
default <T2,T3,T4,R> ReactiveSeq<R> zip4(java.lang.Iterable<? extends T2> second, java.lang.Iterable<? extends T3> third, java.lang.Iterable<? extends T4> fourth, Fn4<? super T,? super T2,? super T3,? super T4,? extends R> fn)
static <T> ReactiveSeq<T> concat(java.util.stream.Stream<? extends T>... streams)
static <T> ReactiveSeq<T> concat(java.util.Spliterator<? extends T>... array)
static <T> ReactiveSeq<T> concat(java.util.stream.Stream<? extends T> left, java.util.stream.Stream<? extends T> right)
concat
in interface java.util.stream.Stream<T>
static <T> ReactiveSeq<T> concat(java.util.Spliterator<? extends T> left, java.util.Spliterator<? extends T> right)
static <T> ReactiveSeq<T> narrowK(Higher<ReactiveSeq.µ,T> future)
future
- HKT encoded list into a ReactiveSeq