T - public class FutureWTSeq<A> extends java.lang.Object implements FutureWT<A>, ValueTransformerSeq<A>, Foldable<A>, ConvertableSequence<A>, CyclopsCollectable<A>, Sequential<A>
| Modifier and Type | Method and Description |
|---|---|
org.jooq.lambda.Collectable<A> |
collectable()
Narrow this class to a Collectable
|
FutureWTSeq<A> |
combine(java.util.function.BiPredicate<? super A,? super A> predicate,
java.util.function.BinaryOperator<A> op)
Combine two adjacent elements in a traversable using the supplied BinaryOperator
This is a stateful grouping & reduction operation.
|
FutureWTSeq<A> |
cycle(int times)
Convert to a Stream with the values repeated specified times
|
FutureWTSeq<A> |
cycle(Monoid<A> m,
int times)
Convert to a Stream with the result of a reduction operation repeated
specified times
|
FutureWTSeq<A> |
cycleUntil(java.util.function.Predicate<? super A> predicate)
Repeat in a Stream until specified predicate holds
|
FutureWTSeq<A> |
cycleWhile(java.util.function.Predicate<? super A> predicate)
Repeat in a Stream while specified predicate holds
|
FutureWTSeq<A> |
distinct() |
FutureWTSeq<A> |
dropRight(int num) |
FutureWTSeq<A> |
dropUntil(java.util.function.Predicate<? super A> p) |
FutureWTSeq<A> |
dropWhile(java.util.function.Predicate<? super A> p) |
<R> FutureWTSeq<R> |
empty() |
static <T> FutureWTSeq<T> |
emptyList() |
MaybeTSeq<A> |
filter(java.util.function.Predicate<? super A> test)
Filter the wrapped Maybe
|
<B> FutureWTSeq<B> |
flatMap(java.util.function.Function<? super A,? extends MonadicValue<? extends B>> f) |
<B> FutureWTSeq<B> |
flatMapT(java.util.function.Function<? super A,FutureWTSeq<B>> f)
Flat Map the wrapped FutureW
|
static <A> FutureWTSeq<A> |
fromAnyM(AnyMSeq<A> anyM)
|
<K> FutureWTSeq<org.jooq.lambda.tuple.Tuple2<K,org.jooq.lambda.Seq<A>>> |
grouped(java.util.function.Function<? super A,? extends K> classifier) |
<K,T,D> FutureWTSeq<org.jooq.lambda.tuple.Tuple2<K,D>> |
grouped(java.util.function.Function<? super A,? extends K> classifier,
java.util.stream.Collector<? super A,T,D> downstream) |
FutureWTSeq<ListX<A>> |
grouped(int groupSize)
Group elements in a Stream
|
<C extends java.util.Collection<? super A>> |
grouped(int size,
java.util.function.Supplier<C> supplier)
Batch elements in a Stream by size into a collection created by the
supplied factory
|
FutureWTSeq<ListX<A>> |
groupedStatefullyWhile(java.util.function.BiPredicate<ListX<? super A>,? super A> predicate)
Create Travesable of Lists where
each List is populated while the supplied bipredicate holds.
|
FutureWTSeq<ListX<A>> |
groupedUntil(java.util.function.Predicate<? super A> predicate)
Create a Traversable batched by List, where each batch is populated until
the predicate holds
|
<C extends java.util.Collection<? super A>> |
groupedUntil(java.util.function.Predicate<? super A> predicate,
java.util.function.Supplier<C> factory)
Create a SequenceM batched by a Collection, where each batch is populated
until the predicate holds
|
FutureWTSeq<ListX<A>> |
groupedWhile(java.util.function.Predicate<? super A> predicate)
Create a Traversable batched by List, where each batch is populated while
the predicate holds
|
<C extends java.util.Collection<? super A>> |
groupedWhile(java.util.function.Predicate<? super A> predicate,
java.util.function.Supplier<C> factory)
Create a SequenceM batched by a Collection, where each batch is populated
while the predicate holds
|
FutureWTSeq<A> |
intersperse(A value)
Returns a stream with a given value interspersed between any two values
of this stream.
|
boolean |
isSeqPresent() |
java.util.Iterator<A> |
iterator() |
static <U,R> java.util.function.Function<FutureWTSeq<U>,FutureWTSeq<R>> |
lift(java.util.function.Function<? super U,? extends R> fn)
Lift a function into one that accepts and returns an FutureWT
This allows multiple monad types to add functionality to existing functions and methods
e.g.
|
static <U1,U2,R> java.util.function.BiFunction<FutureWTSeq<U1>,FutureWTSeq<U2>,FutureWTSeq<R>> |
lift2(java.util.function.BiFunction<? super U1,? super U2,? extends R> fn)
Lift a BiFunction into one that accepts and returns FutureWTs
This allows multiple monad types to add functionality to existing functions and methods
e.g.
|
FutureWTSeq<A> |
limit(long num)
assertThat(ReactiveSeq.of(4,3,6,7).limit(2).toList(),equalTo(Arrays.asList(4,3)); |
FutureWTSeq<A> |
limitLast(int num)
Limit results to the last x elements in a SequenceM
|
FutureWTSeq<A> |
limitUntil(java.util.function.Predicate<? super A> p)
Take elements from the Stream until the predicate returns true, after
which all elements are excluded.
|
FutureWTSeq<A> |
limitWhile(java.util.function.Predicate<? super A> p)
Take elements from the Stream while the predicate holds, once the
predicate returns false all subsequent elements are excluded
|
<B> FutureWTSeq<B> |
map(java.util.function.Function<? super A,? extends B> f)
Map the wrapped FutureW
|
static <A> FutureWTSeq<A> |
of(AnyMSeq<FutureW<A>> monads)
Construct an FutureWT from an AnyM that wraps a monad containing FutureWs
|
static <A> FutureWTSeq<A> |
of(FutureW<A> monads) |
FutureWTSeq<A> |
onEmpty(A value) |
FutureWTSeq<A> |
onEmptyGet(java.util.function.Supplier<? extends A> supplier) |
<X extends java.lang.Throwable> |
onEmptyThrow(java.util.function.Supplier<? extends X> supplier) |
FutureWTSeq<A> |
peek(java.util.function.Consumer<? super A> peek)
Peek at the current value of the FutureW
|
FutureWTSeq<A> |
reverse() |
FutureWTSeq<A> |
scanLeft(Monoid<A> monoid)
Scan left using supplied Monoid
|
<U> FutureWTSeq<U> |
scanLeft(U seed,
java.util.function.BiFunction<? super U,? super A,? extends U> function)
Scan left
|
FutureWTSeq<A> |
scanRight(Monoid<A> monoid)
Scan right
|
<U> FutureWTSeq<U> |
scanRight(U identity,
java.util.function.BiFunction<? super A,? super U,? extends U> combiner)
Scan right
|
FutureWTSeq<A> |
shuffle() |
FutureWTSeq<A> |
shuffle(java.util.Random random) |
FutureWTSeq<A> |
skip(long num)
assertThat(ReactiveSeq.of(4,3,6,7).skip(2).toList(),equalTo(Arrays.asList(6,7))); |
FutureWTSeq<A> |
skipLast(int num)
assertThat(ReactiveSeq.of(1,2,3,4,5) .skipLast(2)
.collect(Collectors.toList()),equalTo(Arrays.asList(1,2,3)));
|
FutureWTSeq<A> |
skipUntil(java.util.function.Predicate<? super A> p)
Drop elements from the Stream until the predicate returns true, after
which all elements are included
|
FutureWTSeq<A> |
skipWhile(java.util.function.Predicate<? super A> p)
SkipWhile drops elements from the Stream while the predicate holds, once
the predicte returns true all subsequent elements are included *
|
FutureWTSeq<A> |
slice(long from,
long to) |
FutureWTSeq<ListX<A>> |
sliding(int windowSize)
Create a sliding view over this Sequence
|
FutureWTSeq<ListX<A>> |
sliding(int windowSize,
int increment)
Create a sliding view over this Sequence
|
FutureWTSeq<A> |
sorted()
assertThat(ReactiveSeq.of(4,3,6,7)).sorted().toList(),equalTo(Arrays.asList(3,4,6,7))); |
FutureWTSeq<A> |
sorted(java.util.Comparator<? super A> 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 A,? extends U> function) |
ReactiveSeq<A> |
stream() |
FutureWTSeq<A> |
takeRight(int num) |
FutureWTSeq<A> |
takeUntil(java.util.function.Predicate<? super A> p) |
FutureWTSeq<A> |
takeWhile(java.util.function.Predicate<? super A> p) |
java.lang.String |
toString() |
AnyMSeq<? extends Traversable<A>> |
transformerStream() |
<R> FutureWTSeq<R> |
unit(R value) |
<T> FutureWTSeq<T> |
unitAnyM(AnyM<Traversable<T>> traversable) |
<R> FutureWTSeq<R> |
unitIterator(java.util.Iterator<R> it) |
<T> FutureWTSeq<T> |
unitStream(ReactiveSeq<T> traversable) |
AnyMSeq<FutureW<A>> |
unwrap() |
<U,R> FutureWTSeq<R> |
zip(java.lang.Iterable<? extends U> other,
java.util.function.BiFunction<? super A,? super U,? extends R> zipper) |
<U> FutureWTSeq<org.jooq.lambda.tuple.Tuple2<A,U>> |
zip(org.jooq.lambda.Seq<? extends U> other)
Zip 2 streams into one
|
<S,U> FutureWTSeq<org.jooq.lambda.tuple.Tuple3<A,S,U>> |
zip3(java.util.stream.Stream<? extends S> second,
java.util.stream.Stream<? extends U> third)
zip 3 Streams into one
|
<T2,T3,T4> FutureWTSeq<org.jooq.lambda.tuple.Tuple4<A,T2,T3,T4>> |
zip4(java.util.stream.Stream<T2> second,
java.util.stream.Stream<T3> third,
java.util.stream.Stream<T4> fourth)
zip 4 Streams into 1
|
<U> FutureWTSeq<org.jooq.lambda.tuple.Tuple2<A,U>> |
zipStream(java.util.stream.Stream<? extends U> other)
Zip 2 streams into one
|
FutureWTSeq<org.jooq.lambda.tuple.Tuple2<A,java.lang.Long>> |
zipWithIndex()
Add an index to the current Stream
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitbind, cast, emptyOptional, filterNot, fromAnyM, fromAnyMSeq, fromAnyMValue, fromFuture, fromIterable, fromIterableValue, fromOptional, fromPublisher, fromStream, fromValue, notNull, of, ofType, patternMatch, trampolinesubscribefutureOperations, lazyOperationsseq, toCompletableFuture, toDequeX, toEvalAlways, toEvalLater, toEvalNow, toFutureStream, toFutureStream, toFutureW, toIor, toIorSecondary, toListX, toMapX, toMaybe, toOptional, toPBagX, toPMapX, toPOrderedSetX, toPQueueX, toPSetX, toPStackX, toPVectorX, toQueueX, toSetX, toSimpleReact, toSimpleReact, toSortedSetX, toStreamable, toTry, toValue, toValueMap, toValueSet, toXor, toXorSecondarytraversablefixedDelay, onePer, xPerfutureStream, getStreamable, isEmpty, jdkStream, reactiveSeq, reveresedJDKStream, reveresedStreamendsWith, endsWithIterable, findAny, findFirst, firstValue, foldable, foldRight, foldRight, foldRight, foldRightMapToType, get, groupBy, headAndTail, join, join, join, mapReduce, mapReduce, print, print, printErr, printOut, reduce, reduce, reduce, reduce, reduce, reduce, reduce, schedule, scheduleFixedDelay, scheduleFixedRate, single, single, singleOptional, startsWith, startsWithIterable, toConcurrentLazyCollection, toConcurrentLazyStreamable, toLazyCollection, validate, visit, visit, xMatchallMatch, anyMatch, avg, avg, avgDouble, avgInt, avgLong, bitAnd, bitAnd, bitAndInt, bitAndLong, bitOr, bitOr, bitOrInt, bitOrLong, collect, commonPrefix, commonSuffix, count, count, countDistinct, countDistinct, countDistinctBy, countDistinctBy, max, max, max, max, maxAll, maxAll, maxAll, maxAll, maxAllBy, maxAllBy, maxBy, maxBy, median, median, medianBy, medianBy, min, min, min, min, minAll, minAll, minAll, minAll, minAllBy, minAllBy, minBy, minBy, mode, modeAll, modeAllBy, modeBy, noneMatch, percentile, percentile, percentileBy, percentileBy, sum, sum, sumDouble, sumInt, sumLong, toCollection, toList, toList, toMap, toMap, toSet, toSet, toString, toStringpublic <T> FutureWTSeq<T> unitStream(ReactiveSeq<T> traversable)
unitStream in interface ValueTransformerSeq<A>public <T> FutureWTSeq<T> unitAnyM(AnyM<Traversable<T>> traversable)
unitAnyM in interface TransformerSeq<A>public AnyMSeq<? extends Traversable<A>> transformerStream()
transformerStream in interface TransformerSeq<A>public MaybeTSeq<A> filter(java.util.function.Predicate<? super A> test)
MaybeT.of(AnyM.fromStream(Maybe.of(10))
.filter(t->t!=10);
//MaybeT<AnyMSeq<Stream<Maybe.empty>>>
public FutureWTSeq<A> peek(java.util.function.Consumer<? super A> peek)
FutureWT.of(AnyM.fromStream(Arrays.asFutureW(10))
.peek(System.out::println);
//prints 10
public <B> FutureWTSeq<B> map(java.util.function.Function<? super A,? extends B> f)
FutureWT.of(AnyM.fromStream(Arrays.asFutureW(10))
.map(t->t=t+1);
//FutureWT<AnyMSeq<Stream<FutureW[11]>>>
public <B> FutureWTSeq<B> flatMapT(java.util.function.Function<? super A,FutureWTSeq<B>> f)
FutureWT.of(AnyM.fromStream(Arrays.asFutureW(10))
.flatMap(t->FutureW.completedFuture(20));
//FutureWT<AnyMSeq<Stream<FutureW[20]>>>
f - FlatMap functionpublic <B> FutureWTSeq<B> flatMap(java.util.function.Function<? super A,? extends MonadicValue<? extends B>> f)
public static <U,R> java.util.function.Function<FutureWTSeq<U>,FutureWTSeq<R>> lift(java.util.function.Function<? super U,? extends R> fn)
Function<Integer,Integer> add2 = i -> i+2;
Function<FutureWT<Integer>, FutureWT<Integer>> optTAdd2 = FutureWT.lift(add2);
Stream<Integer> withNulls = Stream.of(1,2,3);
AnyMSeq<Integer> stream = AnyM.fromStream(withNulls);
AnyMSeq<FutureW<Integer>> streamOpt = stream.map(FutureW::completedFuture);
List<Integer> results = optTAdd2.apply(FutureWT.of(streamOpt))
.unwrap()
.<Stream<FutureW<Integer>>>unwrap()
.map(FutureW::join)
.collect(Collectors.toList());
//FutureW.completedFuture(List[3,4]);
public static <U1,U2,R> java.util.function.BiFunction<FutureWTSeq<U1>,FutureWTSeq<U2>,FutureWTSeq<R>> lift2(java.util.function.BiFunction<? super U1,? super U2,? extends R> fn)
BiFunction<Integer,Integer,Integer> add = (a,b) -> a+b;
BiFunction<FutureWT<Integer>,FutureWT<Integer>,FutureWT<Integer>> optTAdd2 = FutureWT.lift2(add);
Stream<Integer> withNulls = Stream.of(1,2,3);
AnyMSeq<Integer> stream = AnyM.ofMonad(withNulls);
AnyMSeq<FutureW<Integer>> streamOpt = stream.map(FutureW::completedFuture);
FutureW<FutureW<Integer>> two = FutureW.completedFuture(FutureW.completedFuture(2));
AnyMSeq<FutureW<Integer>> future= AnyM.fromFutureW(two);
List<Integer> results = optTAdd2.apply(FutureWT.of(streamOpt),FutureWT.of(future))
.unwrap()
.<Stream<FutureW<Integer>>>unwrap()
.map(FutureW::join)
.collect(Collectors.toList());
//FutureW.completedFuture(List[3,4,5]);
public static <A> FutureWTSeq<A> fromAnyM(AnyMSeq<A> anyM)
anyM - AnyM that doesn't contain a monad wrapping an FutureWpublic static <A> FutureWTSeq<A> of(AnyMSeq<FutureW<A>> monads)
monads - AnyM that contains a monad wrapping an FutureWpublic static <A> FutureWTSeq<A> of(FutureW<A> monads)
public java.lang.String toString()
toString in class java.lang.Objectpublic ReactiveSeq<A> stream()
stream in interface TransformerSeq<A>stream in interface Foldable<A>stream in interface Sequential<A>stream in interface ConvertableSequence<A>stream in interface ToStream<A>stream in interface Traversable<A>public java.util.Iterator<A> iterator()
public <R> FutureWTSeq<R> unitIterator(java.util.Iterator<R> it)
public <R> FutureWTSeq<R> unit(R value)
public <R> FutureWTSeq<R> empty()
public org.jooq.lambda.Collectable<A> collectable()
CyclopsCollectablecollectable in interface CyclopsCollectable<A>public boolean isSeqPresent()
isSeqPresent in interface TransformerSeq<A>public static <T> FutureWTSeq<T> emptyList()
public FutureWTSeq<A> combine(java.util.function.BiPredicate<? super A,? super A> predicate, java.util.function.BinaryOperator<A> op)
Traversable
ReactiveSeq.of(1,1,2,3)
.combine((a, b)->a.equals(b),Semigroups.intSum)
.toListX()
//ListX(3,4)
combine in interface TransformerSeq<A>combine in interface ValueTransformerSeq<A>combine in interface Traversable<A>predicate - Test to see if two neighbours should be joinedop - Reducer to combine neighbourspublic FutureWTSeq<A> cycle(int times)
Traversable
ReactiveSeq.of(1,2,2)
.cycle(3)
.collect(Collectors.toList());
//List[1,2,2,1,2,2,1,2,2]
cycle in interface TransformerSeq<A>cycle in interface ValueTransformerSeq<A>cycle in interface Traversable<A>times - Times values should be repeated within a Streampublic FutureWTSeq<A> cycle(Monoid<A> m, int times)
Traversable
List<Integer> list = ReactiveSeq.of(1,2,2))
.cycle(Reducers.toCountInt(),3)
.collect(Collectors.toList());
//List[3,3,3];
cycle in interface TransformerSeq<A>cycle in interface ValueTransformerSeq<A>cycle in interface Traversable<A>m - Monoid to be used in reductiontimes - Number of times value should be repeatedpublic FutureWTSeq<A> cycleWhile(java.util.function.Predicate<? super A> predicate)
Traversable
{
@code
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 TransformerSeq<A>cycleWhile in interface ValueTransformerSeq<A>cycleWhile in interface Traversable<A>predicate - repeat while truepublic FutureWTSeq<A> cycleUntil(java.util.function.Predicate<? super A> predicate)
Traversable
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 TransformerSeq<A>cycleUntil in interface ValueTransformerSeq<A>cycleUntil in interface Traversable<A>predicate - repeat while truepublic <U,R> FutureWTSeq<R> zip(java.lang.Iterable<? extends U> other, java.util.function.BiFunction<? super A,? super U,? extends R> zipper)
zip in interface TransformerSeq<A>zip in interface ValueTransformerSeq<A>zip in interface Traversable<A>public <U> FutureWTSeq<org.jooq.lambda.tuple.Tuple2<A,U>> zipStream(java.util.stream.Stream<? extends U> other)
Traversable
{
@code
List<Tuple2<Integer, String>> list = of(1, 2).zip(of("a", "b", "c", "d")).toList();
// [[1,"a"],[2,"b"]]
}
zipStream in interface TransformerSeq<A>zipStream in interface ValueTransformerSeq<A>zipStream in interface Traversable<A>public <U> FutureWTSeq<org.jooq.lambda.tuple.Tuple2<A,U>> zip(org.jooq.lambda.Seq<? extends U> other)
Traversable
{
@code
List<Tuple2<Integer, String>> list = of(1, 2).zip(of("a", "b", "c", "d")).toList();
// [[1,"a"],[2,"b"]]
}
zip in interface TransformerSeq<A>zip in interface ValueTransformerSeq<A>zip in interface Traversable<A>public <S,U> FutureWTSeq<org.jooq.lambda.tuple.Tuple3<A,S,U>> zip3(java.util.stream.Stream<? extends S> second, java.util.stream.Stream<? extends U> third)
Traversable
{
@code
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']]
}
zip3 in interface TransformerSeq<A>zip3 in interface ValueTransformerSeq<A>zip3 in interface Traversable<A>public <T2,T3,T4> FutureWTSeq<org.jooq.lambda.tuple.Tuple4<A,T2,T3,T4>> zip4(java.util.stream.Stream<T2> second, java.util.stream.Stream<T3> third, java.util.stream.Stream<T4> fourth)
Traversable
{
@code
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"]]
zip4 in interface TransformerSeq<A>zip4 in interface ValueTransformerSeq<A>zip4 in interface Traversable<A>public FutureWTSeq<org.jooq.lambda.tuple.Tuple2<A,java.lang.Long>> zipWithIndex()
Traversable
assertEquals(asList(new Tuple2("a", 0L), new Tuple2("b", 1L)), of("a", "b").zipWithIndex().toList());
zipWithIndex in interface TransformerSeq<A>zipWithIndex in interface ValueTransformerSeq<A>zipWithIndex in interface Traversable<A>public FutureWTSeq<ListX<A>> sliding(int windowSize)
Traversable
{
@code
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 TransformerSeq<A>sliding in interface ValueTransformerSeq<A>sliding in interface Traversable<A>windowSize - Size of sliding windowpublic FutureWTSeq<ListX<A>> sliding(int windowSize, int increment)
Traversable
{
@code
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 TransformerSeq<A>sliding in interface ValueTransformerSeq<A>sliding in interface Traversable<A>windowSize - number of elements in each batchincrement - for each windowpublic <C extends java.util.Collection<? super A>> FutureWTSeq<C> grouped(int size, java.util.function.Supplier<C> supplier)
Traversable
assertThat(ReactiveSeq.of(1,1,1,1,1,1)
.batchBySize(3,()->new TreeSet<>())
.toList()
.get(0)
.size(),is(1));
grouped in interface TransformerSeq<A>grouped in interface ValueTransformerSeq<A>grouped in interface Traversable<A>size - batch sizesupplier - Collection factorypublic FutureWTSeq<ListX<A>> groupedUntil(java.util.function.Predicate<? super A> predicate)
Traversable
assertThat(ReactiveSeq.of(1,2,3,4,5,6)
.groupedUntil(i->i%3==0)
.toList()
.size(),equalTo(2));
groupedUntil in interface TransformerSeq<A>groupedUntil in interface ValueTransformerSeq<A>groupedUntil in interface Traversable<A>predicate - Batch until predicate holds, then open next batchpublic FutureWTSeq<ListX<A>> groupedStatefullyWhile(java.util.function.BiPredicate<ListX<? super A>,? super A> predicate)
Traversable
assertThat(ReactiveSeq.of(1,2,3,4,5,6)
.groupedStatefullyWhile((s,i)->s.contains(4) ? true : false)
.toList().size(),equalTo(5));
groupedStatefullyWhile in interface TransformerSeq<A>groupedStatefullyWhile in interface ValueTransformerSeq<A>groupedStatefullyWhile in interface Traversable<A>predicate - Window while truepublic FutureWTSeq<ListX<A>> groupedWhile(java.util.function.Predicate<? super A> predicate)
Traversable
assertThat(ReactiveSeq.of(1,2,3,4,5,6)
.groupedWhile(i->i%3!=0)
.toList().size(),equalTo(2));
groupedWhile in interface TransformerSeq<A>groupedWhile in interface ValueTransformerSeq<A>groupedWhile in interface Traversable<A>predicate - Batch while predicate holds, then open next batchpublic <C extends java.util.Collection<? super A>> FutureWTSeq<C> groupedWhile(java.util.function.Predicate<? super A> predicate, java.util.function.Supplier<C> factory)
Traversable
assertThat(ReactiveSeq.of(1,2,3,4,5,6)
.batchWhile(i->i%3!=0)
.toList()
.size(),equalTo(2));
groupedWhile in interface TransformerSeq<A>groupedWhile in interface ValueTransformerSeq<A>groupedWhile in interface Traversable<A>predicate - Batch while predicate holds, then open next batchfactory - Collection factorypublic <C extends java.util.Collection<? super A>> FutureWTSeq<C> groupedUntil(java.util.function.Predicate<? super A> predicate, java.util.function.Supplier<C> factory)
Traversable
assertThat(ReactiveSeq.of(1,2,3,4,5,6)
.batchUntil(i->i%3!=0)
.toList()
.size(),equalTo(2));
groupedUntil in interface TransformerSeq<A>groupedUntil in interface ValueTransformerSeq<A>groupedUntil in interface Traversable<A>predicate - Batch until predicate holds, then open next batchfactory - Collection factorypublic FutureWTSeq<ListX<A>> grouped(int groupSize)
Traversable
{
@code
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 TransformerSeq<A>grouped in interface ValueTransformerSeq<A>grouped in interface Traversable<A>groupSize - Size of each Grouppublic <K,T,D> FutureWTSeq<org.jooq.lambda.tuple.Tuple2<K,D>> grouped(java.util.function.Function<? super A,? extends K> classifier, java.util.stream.Collector<? super A,T,D> downstream)
grouped in interface TransformerSeq<A>grouped in interface ValueTransformerSeq<A>grouped in interface Traversable<A>public <K> FutureWTSeq<org.jooq.lambda.tuple.Tuple2<K,org.jooq.lambda.Seq<A>>> grouped(java.util.function.Function<? super A,? extends K> classifier)
grouped in interface TransformerSeq<A>grouped in interface ValueTransformerSeq<A>grouped in interface Traversable<A>public FutureWTSeq<A> distinct()
distinct in interface TransformerSeq<A>distinct in interface ValueTransformerSeq<A>distinct in interface Traversable<A>public FutureWTSeq<A> scanLeft(Monoid<A> monoid)
Traversable
assertEquals(asList("", "a", "ab", "abc"),ReactiveSeq.of("a", "b", "c")
.scanLeft(Reducers.toString("")).toList());
scanLeft in interface TransformerSeq<A>scanLeft in interface ValueTransformerSeq<A>scanLeft in interface Traversable<A>public <U> FutureWTSeq<U> scanLeft(U seed, java.util.function.BiFunction<? super U,? super A,? extends U> function)
Traversable
assertThat(of("a", "b", "c").scanLeft("", String::concat).toList().size(),
is(4));
scanLeft in interface TransformerSeq<A>scanLeft in interface ValueTransformerSeq<A>scanLeft in interface Traversable<A>public FutureWTSeq<A> scanRight(Monoid<A> monoid)
Traversable
assertThat(of("a", "b", "c").scanRight(Monoid.of("", String::concat)).toList().size(),
is(asList("", "c", "bc", "abc").size()));
scanRight in interface TransformerSeq<A>scanRight in interface ValueTransformerSeq<A>scanRight in interface Traversable<A>public <U> FutureWTSeq<U> scanRight(U identity, java.util.function.BiFunction<? super A,? super U,? extends U> combiner)
Traversable
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 TransformerSeq<A>scanRight in interface ValueTransformerSeq<A>scanRight in interface Traversable<A>public FutureWTSeq<A> sorted()
Traversable
assertThat(ReactiveSeq.of(4,3,6,7)).sorted().toList(),equalTo(Arrays.asList(3,4,6,7)));
sorted in interface TransformerSeq<A>sorted in interface ValueTransformerSeq<A>sorted in interface Traversable<A>public FutureWTSeq<A> sorted(java.util.Comparator<? super A> c)
Traversable
assertThat(ReactiveSeq.of(4,3,6,7).sorted((a,b) -> b-a).toList(),equalTo(Arrays.asList(7,6,4,3)));
sorted in interface TransformerSeq<A>sorted in interface ValueTransformerSeq<A>sorted in interface Traversable<A>c - Compartor to sort withpublic FutureWTSeq<A> takeWhile(java.util.function.Predicate<? super A> p)
takeWhile in interface TransformerSeq<A>takeWhile in interface ValueTransformerSeq<A>takeWhile in interface Traversable<A>public FutureWTSeq<A> dropWhile(java.util.function.Predicate<? super A> p)
dropWhile in interface TransformerSeq<A>dropWhile in interface ValueTransformerSeq<A>dropWhile in interface Traversable<A>public FutureWTSeq<A> takeUntil(java.util.function.Predicate<? super A> p)
takeUntil in interface TransformerSeq<A>takeUntil in interface ValueTransformerSeq<A>takeUntil in interface Traversable<A>public FutureWTSeq<A> dropUntil(java.util.function.Predicate<? super A> p)
dropUntil in interface TransformerSeq<A>dropUntil in interface ValueTransformerSeq<A>dropUntil in interface Traversable<A>public FutureWTSeq<A> dropRight(int num)
dropRight in interface TransformerSeq<A>dropRight in interface ValueTransformerSeq<A>dropRight in interface Traversable<A>public FutureWTSeq<A> takeRight(int num)
takeRight in interface TransformerSeq<A>takeRight in interface ValueTransformerSeq<A>takeRight in interface Traversable<A>public FutureWTSeq<A> skip(long num)
Traversable
assertThat(ReactiveSeq.of(4,3,6,7).skip(2).toList(),equalTo(Arrays.asList(6,7)));
skip in interface TransformerSeq<A>skip in interface ValueTransformerSeq<A>skip in interface Traversable<A>num - Number of elemenets to skippublic FutureWTSeq<A> skipWhile(java.util.function.Predicate<? super A> p)
Traversable
assertThat(ReactiveSeq.of(4,3,6,7).sorted().skipWhile(i->i<6).toList(),equalTo(Arrays.asList(6,7)));
skipWhile in interface TransformerSeq<A>skipWhile in interface ValueTransformerSeq<A>skipWhile in interface Traversable<A>p - Predicate to skip while truepublic FutureWTSeq<A> skipUntil(java.util.function.Predicate<? super A> p)
Traversable
assertThat(ReactiveSeq.of(4,3,6,7).skipUntil(i->i==6).toList(),equalTo(Arrays.asList(6,7)));
skipUntil in interface TransformerSeq<A>skipUntil in interface ValueTransformerSeq<A>skipUntil in interface Traversable<A>p - Predicate to skip until truepublic FutureWTSeq<A> limit(long num)
Traversable
assertThat(ReactiveSeq.of(4,3,6,7).limit(2).toList(),equalTo(Arrays.asList(4,3));
limit in interface TransformerSeq<A>limit in interface ValueTransformerSeq<A>limit in interface Traversable<A>num - Limit element size to numpublic FutureWTSeq<A> limitWhile(java.util.function.Predicate<? super A> p)
Traversable
assertThat(ReactiveSeq.of(4,3,6,7).sorted().limitWhile(i->i<6).toList(),equalTo(Arrays.asList(3,4)));
limitWhile in interface TransformerSeq<A>limitWhile in interface ValueTransformerSeq<A>limitWhile in interface Traversable<A>p - Limit while predicate is truepublic FutureWTSeq<A> limitUntil(java.util.function.Predicate<? super A> p)
Traversable
assertThat(ReactiveSeq.of(4,3,6,7).limitUntil(i->i==6).toList(),equalTo(Arrays.asList(4,3)));
limitUntil in interface TransformerSeq<A>limitUntil in interface ValueTransformerSeq<A>limitUntil in interface Traversable<A>p - Limit until predicate is truepublic FutureWTSeq<A> intersperse(A value)
Traversableintersperse in interface TransformerSeq<A>intersperse in interface ValueTransformerSeq<A>intersperse in interface Traversable<A>public FutureWTSeq<A> reverse()
reverse in interface TransformerSeq<A>reverse in interface ValueTransformerSeq<A>reverse in interface Traversable<A>public FutureWTSeq<A> shuffle()
shuffle in interface TransformerSeq<A>shuffle in interface ValueTransformerSeq<A>shuffle in interface Traversable<A>public FutureWTSeq<A> skipLast(int num)
TraversableskipLast in interface TransformerSeq<A>skipLast in interface ValueTransformerSeq<A>skipLast in interface Traversable<A>public FutureWTSeq<A> limitLast(int num)
Traversable
assertThat(ReactiveSeq.of(1,2,3,4,5)
.limitLast(2)
.collect(Collectors.toList()),equalTo(Arrays.asList(4,5)));
limitLast in interface TransformerSeq<A>limitLast in interface ValueTransformerSeq<A>limitLast in interface Traversable<A>num - of elements to return (last elements)public FutureWTSeq<A> onEmpty(A value)
onEmpty in interface TransformerSeq<A>onEmpty in interface ValueTransformerSeq<A>onEmpty in interface Traversable<A>public FutureWTSeq<A> onEmptyGet(java.util.function.Supplier<? extends A> supplier)
onEmptyGet in interface TransformerSeq<A>onEmptyGet in interface ValueTransformerSeq<A>onEmptyGet in interface Traversable<A>public <X extends java.lang.Throwable> FutureWTSeq<A> onEmptyThrow(java.util.function.Supplier<? extends X> supplier)
onEmptyThrow in interface TransformerSeq<A>onEmptyThrow in interface ValueTransformerSeq<A>onEmptyThrow in interface Traversable<A>public FutureWTSeq<A> shuffle(java.util.Random random)
shuffle in interface TransformerSeq<A>shuffle in interface ValueTransformerSeq<A>shuffle in interface Traversable<A>public FutureWTSeq<A> slice(long from, long to)
slice in interface TransformerSeq<A>slice in interface ValueTransformerSeq<A>slice in interface Traversable<A>public <U extends java.lang.Comparable<? super U>> FutureWTSeq<A> sorted(java.util.function.Function<? super A,? extends U> function)
sorted in interface TransformerSeq<A>sorted in interface ValueTransformerSeq<A>sorted in interface Traversable<A>