Package org.aksw.commons.rx.op
Class FlowableOperatorReadAhead<T>
java.lang.Object
org.aksw.commons.rx.op.FlowableOperatorReadAhead<T>
- Type Parameters:
T- Item typeK- Group key typeV- Accumulator type
- All Implemented Interfaces:
io.reactivex.rxjava3.core.FlowableOperator<T,T>
public final class FlowableOperatorReadAhead<T>
extends Object
implements io.reactivex.rxjava3.core.FlowableOperator<T,T>
Flowable<Entry<Integer, List<Integer>>> list = Flowable
.range(0, 10)
.map(i -> Maps.immutableEntry((int)(i / 3), i))
.lift(FlowableOperatorSequentialGroupBy.<Entry<Integer, Integer>, Integer, List<Integer>>create(Entry::getKey, ArrayList::new, (acc, e) -> acc.add(e.getValue())));
- Author:
- raven
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.reactivestreams.Subscriber<? super T>static <T> FlowableOperatorReadAhead<T>create(int readAheadAmount) Create method with the following characteristics: the accumulator constructor is a mere supplier (and thus neither depends on the accumulator count nor the group Key) Group keys are compared using Objects::equals
-
Field Details
-
readAheadAmount
protected int readAheadAmountThe amount of items to read ahead
-
-
Constructor Details
-
FlowableOperatorReadAhead
public FlowableOperatorReadAhead(int readAheadAmount)
-
-
Method Details
-
create
Create method with the following characteristics:- the accumulator constructor is a mere supplier (and thus neither depends on the accumulator count nor the group Key)
- Group keys are compared using Objects::equals
-
apply
-