T
- Data type of the elements stored inside the traversable manipulated by this monad transformerpublic interface TransformerTraversable<T>
Modifier and Type | Method and Description |
---|---|
default ListTSeq<T> |
groupedStatefullyUntilT(java.util.function.BiPredicate<ListX<? super T>,? super T> predicate)
List Transformer view into batched Lists where
each List is populated while the supplied bipredicate holds.
|
default ListTSeq<T> |
groupedT(int groupSize)
Group the elements in this Traversable into batches of the provided size.
|
default ListTSeq<T> |
groupedUntilT(java.util.function.Predicate<? super T> predicate)
Create a Traversable batched by List, where each batch is populated until
the predicate holds.
|
default ListTSeq<T> |
groupedWhileT(java.util.function.Predicate<? super T> predicate)
Create a Traversable batched by List, where each batch is populated while
the predicate holds.
|
default ListTSeq<T> |
slidingT(int windowSize)
Create a Sliding window into the data in this traversble.
|
default ListTSeq<T> |
slidingT(int windowSize,
int increment)
Create a Sliding window into the data in this traversble.
|
ReactiveSeq<T> |
stream() |
default ListTSeq<T> groupedT(int groupSize)
ListTSeq<Integer> transformer = ReactiveSeq.of(2,1,3,4,5,7,6,8,9,10)
.groupedT(4);
//ReactiveSeq[List[2,1,3,4],List[5,7,6,8],List[9,10]]
ListTSeq<ListX<Integer>> nested = transformer.map(i->i*2)
.sorted()
.grouped(2);
//ReactiveSeq[List[List[2,4],List[6,8]],List[List[10,14],List[12,16]],List[List[18,20]]]
groupSize
- Size of each batch of elements to be grouped into Listsdefault ListTSeq<T> slidingT(int windowSize, int increment)
ListTSeq<Integer> sliding = ListX.of(1,2,3,4,5,6,7)
.sliding(3,2);
//ReactiveSeq[List[1,2,3],List[3,4,5],List[5,6,7],List[7]]
windowSize
- Size of sliding windowincrement
- Increment between windowsdefault ListTSeq<T> slidingT(int windowSize)
ListTSeq<Integer> sliding = ListX.of(1,2,3,4,5,6,7)
.sliding(3);
//ReactiveSeq[List[1,2,3],List[2,3,4],List[4,5,6],List[6,7]]
windowSize
- Size of sliding windowdefault ListTSeq<T> groupedUntilT(java.util.function.Predicate<? super T> predicate)
ListTSeq<Integer> grouped = ReactiveSeq.of(1,2,3,4,5,6)
.groupedWhile(i->i%3!=0)
.toList();
//ReactiveSeq[List[1,2,3],List[4,5,6]]
predicate
- Predicate to determine batch termination pointdefault ListTSeq<T> groupedStatefullyUntilT(java.util.function.BiPredicate<ListX<? super T>,? super T> predicate)
predicate
- Predicate to determine batchdefault ListTSeq<T> groupedWhileT(java.util.function.Predicate<? super T> predicate)
ListTSeq<Integer> grouped = ReactiveSeq.of(1,2,3,4,5,6,7,8,9,5)
.groupedUntil(i->i==5)
.toList();
//ReactiveSeq[List[1,2,3,4,5],List[6,7,8,9,5]]
predicate
- Predicate to determine batch termination pointReactiveSeq<T> stream()