Class FlowableOperatorConditionalConcat<T,C>

java.lang.Object
org.aksw.commons.rx.op.FlowableOperatorConditionalConcat<T,C>
Type Parameters:
T - Item type
K - Group key type
V - Accumulator type
All Implemented Interfaces:
io.reactivex.rxjava3.core.FlowableOperator<T,T>

public final class FlowableOperatorConditionalConcat<T,C> extends Object implements io.reactivex.rxjava3.core.FlowableOperator<T,T>
Track all seen items of the downstream flowable. When the downstream completes, invoke an action that creates a new publisher based on the seen items that will be concatenated.

 		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
    Modifier and Type
    Class
    Description
    class 
    This subscriber first consumes the initial upstream and caches all seen items.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected org.aksw.commons.collector.domain.Aggregator<T,?,C>
    The amount of items to read ahead
    protected Function<? super C,io.reactivex.rxjava3.core.Flowable<T>>
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    FlowableOperatorConditionalConcat(org.aksw.commons.collector.domain.Aggregator<T,?,C> aggregator, Function<? super C,io.reactivex.rxjava3.core.Flowable<T>> tailFlowFactory)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    org.reactivestreams.Subscriber<? super T>
    apply(org.reactivestreams.Subscriber<? super T> downstream)
     
    create(org.aksw.commons.collector.domain.Aggregator<T,?,C> aggregator, Function<C,io.reactivex.rxjava3.core.Flowable<T>> tailFlowFactory)
    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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • aggregator

      protected org.aksw.commons.collector.domain.Aggregator<T,?,C> aggregator
      The amount of items to read ahead
    • tailFlowFactory

      protected Function<? super C,io.reactivex.rxjava3.core.Flowable<T>> tailFlowFactory
  • Constructor Details

    • FlowableOperatorConditionalConcat

      public FlowableOperatorConditionalConcat(org.aksw.commons.collector.domain.Aggregator<T,?,C> aggregator, Function<? super C,io.reactivex.rxjava3.core.Flowable<T>> tailFlowFactory)
  • Method Details

    • create

      public static <T, C> FlowableOperatorConditionalConcat<T,C> create(org.aksw.commons.collector.domain.Aggregator<T,?,C> aggregator, Function<C,io.reactivex.rxjava3.core.Flowable<T>> tailFlowFactory)
      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

      public org.reactivestreams.Subscriber<? super T> apply(org.reactivestreams.Subscriber<? super T> downstream) throws Exception
      Specified by:
      apply in interface io.reactivex.rxjava3.core.FlowableOperator<T,C>
      Throws:
      Exception