signature:
public class Flowable { /** * Returns a Flowable that mirrors the source Publisher , except that it drops items emitted by the
 * source Publisher that are followed by newer items before a timeout value expires on a specified
 * Scheduler . The timer resets on each emission .
 * < em > Note : < / em > If items keep being emitted by the source Publisher faster than the timeout then no items
 * will be emitted by the resulting Publisher .
 * < img width = " 640 " height = " 310 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / debounce . s . png " alt = " " >
 * Delivery of the item after the grace period happens on the given { @ code Scheduler } ' s
 * { @ code Worker } which if takes too long , a newer item may arrive from the upstream , causing the
 * { @ code Worker } ' s task to get disposed , which may also interrupt any downstream blocking operation
 * ( yielding an { @ code InterruptedException } ) . It is recommended processing items
 * that may take long time to be moved to another thread via { @ link # observeOn } applied after
 * { @ code debounce } itself .
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > This operator does not support backpressure as it uses time to control data flow . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > You specify which { @ link Scheduler } this operator will use . < / dd >
 * < / dl >
 * @ param timeout
 * the time each item has to be " the most recent " of those emitted by the source Publisher to
 * ensure that it ' s not dropped
 * @ param unit
 * the unit of time for the specified { @ code timeout }
 * @ param scheduler
 * the { @ link Scheduler } to use internally to manage the timers that handle the timeout for each
 * item
 * @ return a Flowable that filters out items from the source Publisher that are too quickly followed by
 * newer items
 * @ see < a href = " http : / / reactivex . io / documentation / operators / debounce . html " > ReactiveX operators documentation : Debounce < / a >
 * @ see < a href = " https : / / github . com / ReactiveX / RxJava / wiki / Backpressure " > RxJava wiki : Backpressure < / a >
 * @ see # throttleWithTimeout ( long , TimeUnit , Scheduler ) */
@ CheckReturnValue @ NonNull @ BackpressureSupport ( BackpressureKind . ERROR ) @ SchedulerSupport ( SchedulerSupport . CUSTOM ) public final Flowable < T > debounce ( long timeout , TimeUnit unit , Scheduler scheduler ) { } }

implementation: ObjectHelper . requireNonNull ( unit , "unit is null" ) ; ObjectHelper . requireNonNull ( scheduler , "scheduler is null" ) ; return RxJavaPlugins . onAssembly ( new FlowableDebounceTimed < T > ( this , timeout , unit , scheduler ) ) ;


signature:
public class Flowable { /** * Returns a Flowable that emits the items emitted by the source Publisher shifted forward in time by a
 * specified delay . If { @ code delayError } is true , error notifications will also be delayed .
 * < img width = " 640 " height = " 310 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / delay . png " alt = " " >
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > The operator doesn ' t interfere with the backpressure behavior which is determined by the source { @ code Publisher } . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > This version of { @ code delay } operates by default on the { @ code computation } { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param delay
 * the delay to shift the source by
 * @ param unit
 * the { @ link TimeUnit } in which { @ code period } is defined
 * @ param delayError
 * if true , the upstream exception is signaled with the given delay , after all preceding normal elements ,
 * if false , the upstream exception is signaled immediately
 * @ return the source Publisher shifted in time by the specified delay
 * @ see < a href = " http : / / reactivex . io / documentation / operators / delay . html " > ReactiveX operators documentation : Delay < / a > */
@ CheckReturnValue @ BackpressureSupport ( BackpressureKind . FULL ) @ SchedulerSupport ( SchedulerSupport . COMPUTATION ) public final Flowable < T > delay ( long delay , TimeUnit unit , boolean delayError ) { } }

implementation: return delay ( delay , unit , Schedulers . computation ( ) , delayError ) ;


signature:
public class Flowable { /** * Returns a Flowable that emits the items emitted by the source Publisher shifted forward in time by a
 * specified delay . Error notifications from the source Publisher are not delayed .
 * < img width = " 640 " height = " 310 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / delay . s . png " alt = " " >
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > The operator doesn ' t interfere with the backpressure behavior which is determined by the source { @ code Publisher } . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > You specify which { @ link Scheduler } this operator will use . < / dd >
 * < / dl >
 * @ param delay
 * the delay to shift the source by
 * @ param unit
 * the time unit of { @ code delay }
 * @ param scheduler
 * the { @ link Scheduler } to use for delaying
 * @ return the source Publisher shifted in time by the specified delay
 * @ see < a href = " http : / / reactivex . io / documentation / operators / delay . html " > ReactiveX operators documentation : Delay < / a > */
@ CheckReturnValue @ BackpressureSupport ( BackpressureKind . FULL ) @ SchedulerSupport ( SchedulerSupport . CUSTOM ) public final Flowable < T > delay ( long delay , TimeUnit unit , Scheduler scheduler ) { } }

implementation: return delay ( delay , unit , scheduler , false ) ;


signature:
public class Flowable { /** * Returns a Flowable that delays the subscription to and emissions from the source Publisher via another
 * Publisher on a per - item basis .
 * < img width = " 640 " height = " 450 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / delay . oo . png " alt = " " >
 * < em > Note : < / em > the resulting Publisher will immediately propagate any { @ code onError } notification
 * from the source Publisher .
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > The operator doesn ' t interfere with the backpressure behavior which is determined by the source { @ code Publisher } .
 * All of the other { @ code Publisher } s supplied by the functions are consumed
 * in an unbounded manner ( i . e . , no backpressure applied to them ) . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > This version of { @ code delay } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param < U >
 * the subscription delay value type ( ignored )
 * @ param < V >
 * the item delay value type ( ignored )
 * @ param subscriptionIndicator
 * a function that returns a Publisher that triggers the subscription to the source Publisher
 * once it emits any item
 * @ param itemDelayIndicator
 * a function that returns a Publisher for each item emitted by the source Publisher , which is
 * then used to delay the emission of that item by the resulting Publisher until the Publisher
 * returned from { @ code itemDelay } emits an item
 * @ return a Flowable that delays the subscription and emissions of the source Publisher via another
 * Publisher on a per - item basis
 * @ see < a href = " http : / / reactivex . io / documentation / operators / delay . html " > ReactiveX operators documentation : Delay < / a > */
@ CheckReturnValue @ BackpressureSupport ( BackpressureKind . FULL ) @ SchedulerSupport ( SchedulerSupport . NONE ) public final < U , V > Flowable < T > delay ( Publisher < U > subscriptionIndicator , Function < ? super T , ? extends Publisher < V > > itemDelayIndicator ) { } }

implementation: return delaySubscription ( subscriptionIndicator ) . delay ( itemDelayIndicator ) ;


signature:
public class Flowable { /** * Returns a Flowable that reverses the effect of { @ link # materialize materialize } by transforming the
 * { @ link Notification } objects emitted by the source Publisher into the items or notifications they
 * represent .
 * < img width = " 640 " height = " 335 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / dematerialize . png " alt = " " >
 * When the upstream signals an { @ link Notification # createOnError ( Throwable ) onError } or
 * { @ link Notification # createOnComplete ( ) onComplete } item , the
 * returned Flowable cancels the flow and terminates with that type of terminal event :
 * < pre > < code >
 * Flowable . just ( createOnNext ( 1 ) , createOnComplete ( ) , createOnNext ( 2 ) )
 * . doOnCancel ( ( ) - & gt ; System . out . println ( " Cancelled ! " ) ) ;
 * . dematerialize ( )
 * . test ( )
 * . assertResult ( 1 ) ;
 * < / code > < / pre >
 * If the upstream signals { @ code onError } or { @ code onComplete } directly , the flow is terminated
 * with the same event .
 * < pre > < code >
 * Flowable . just ( createOnNext ( 1 ) , createOnNext ( 2 ) )
 * . dematerialize ( )
 * . test ( )
 * . assertResult ( 1 , 2 ) ;
 * < / code > < / pre >
 * If this behavior is not desired , the completion can be suppressed by applying { @ link # concatWith ( Publisher ) }
 * with a { @ link # never ( ) } source .
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > The operator doesn ' t interfere with backpressure which is determined by the source { @ code Publisher } ' s
 * backpressure behavior . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code dematerialize } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param < T2 > the output value type
 * @ return a Flowable that emits the items and notifications embedded in the { @ link Notification } objects
 * emitted by the source Publisher
 * @ see < a href = " http : / / reactivex . io / documentation / operators / materialize - dematerialize . html " > ReactiveX operators documentation : Dematerialize < / a >
 * @ see # dematerialize ( Function )
 * @ deprecated in 2.2.4 ; inherently type - unsafe as it overrides the output generic type . Use { @ link # dematerialize ( Function ) } instead . */
@ CheckReturnValue @ SchedulerSupport ( SchedulerSupport . NONE ) @ BackpressureSupport ( BackpressureKind . PASS_THROUGH ) @ Deprecated @ SuppressWarnings ( { } }

implementation: "unchecked" , "rawtypes" } ) public final < T2 > Flowable < T2 > dematerialize ( ) { return RxJavaPlugins . onAssembly ( new FlowableDematerialize ( this , Functions . identity ( ) ) ) ;


signature:
public class Flowable { /** * Returns a Flowable that reverses the effect of { @ link # materialize materialize } by transforming the
 * { @ link Notification } objects extracted from the source items via a selector function
 * into their respective { @ code Subscriber } signal types .
 * < img width = " 640 " height = " 335 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / dematerialize . png " alt = " " >
 * The intended use of the { @ code selector } function is to perform a
 * type - safe identity mapping ( see example ) on a source that is already of type
 * { @ code Notification < T > } . The Java language doesn ' t allow
 * limiting instance methods to a certain generic argument shape , therefore ,
 * a function is used to ensure the conversion remains type safe .
 * When the upstream signals an { @ link Notification # createOnError ( Throwable ) onError } or
 * { @ link Notification # createOnComplete ( ) onComplete } item , the
 * returned Flowable cancels of the flow and terminates with that type of terminal event :
 * < pre > < code >
 * Flowable . just ( createOnNext ( 1 ) , createOnComplete ( ) , createOnNext ( 2 ) )
 * . doOnCancel ( ( ) - & gt ; System . out . println ( " Canceled ! " ) ) ;
 * . dematerialize ( notification - & gt ; notification )
 * . test ( )
 * . assertResult ( 1 ) ;
 * < / code > < / pre >
 * If the upstream signals { @ code onError } or { @ code onComplete } directly , the flow is terminated
 * with the same event .
 * < pre > < code >
 * Flowable . just ( createOnNext ( 1 ) , createOnNext ( 2 ) )
 * . dematerialize ( notification - & gt ; notification )
 * . test ( )
 * . assertResult ( 1 , 2 ) ;
 * < / code > < / pre >
 * If this behavior is not desired , the completion can be suppressed by applying { @ link # concatWith ( Publisher ) }
 * with a { @ link # never ( ) } source .
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > The operator doesn ' t interfere with backpressure which is determined by the source { @ code Publisher } ' s
 * backpressure behavior . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code dematerialize } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param < R > the output value type
 * @ param selector function that returns the upstream item and should return a Notification to signal
 * the corresponding { @ code Subscriber } event to the downstream .
 * @ return a Flowable that emits the items and notifications embedded in the { @ link Notification } objects
 * selected from the items emitted by the source Flowable
 * @ see < a href = " http : / / reactivex . io / documentation / operators / materialize - dematerialize . html " > ReactiveX operators documentation : Dematerialize < / a >
 * @ since 2.2.4 - experimental */
@ Experimental @ CheckReturnValue @ NonNull @ SchedulerSupport ( SchedulerSupport . NONE ) @ BackpressureSupport ( BackpressureKind . PASS_THROUGH ) public final < R > Flowable < R > dematerialize ( Function < ? super T , Notification < R > > selector ) { } }

implementation: ObjectHelper . requireNonNull ( selector , "selector is null" ) ; return RxJavaPlugins . onAssembly ( new FlowableDematerialize < T , R > ( this , selector ) ) ;


signature:
public class Flowable { /** * Returns a Flowable that emits all items emitted by the source Publisher that are distinct
 * based on { @ link Object # equals ( Object ) } comparison .
 * < img width = " 640 " height = " 310 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / distinct . png " alt = " " >
 * It is recommended the elements ' class { @ code T } in the flow overrides the default { @ code Object . equals ( ) } and { @ link Object # hashCode ( ) } to provide
 * a meaningful comparison between items as the default Java implementation only considers reference equivalence .
 * By default , { @ code distinct ( ) } uses an internal { @ link java . util . HashSet } per Subscriber to remember
 * previously seen items and uses { @ link java . util . Set # add ( Object ) } returning { @ code false } as the
 * indicator for duplicates .
 * Note that this internal { @ code HashSet } may grow unbounded as items won ' t be removed from it by
 * the operator . Therefore , using very long or infinite upstream ( with very distinct elements ) may lead
 * to { @ code OutOfMemoryError } .
 * Customizing the retention policy can happen only by providing a custom { @ link java . util . Collection } implementation
 * to the { @ link # distinct ( Function , Callable ) } overload .
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > The operator doesn ' t interfere with backpressure which is determined by the source { @ code Publisher } ' s
 * backpressure behavior . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code distinct } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ return a Flowable that emits only those items emitted by the source Publisher that are distinct from
 * each other
 * @ see < a href = " http : / / reactivex . io / documentation / operators / distinct . html " > ReactiveX operators documentation : Distinct < / a >
 * @ see # distinct ( Function )
 * @ see # distinct ( Function , Callable ) */
@ SuppressWarnings ( { } }

implementation: "rawtypes" , "unchecked" } ) @ CheckReturnValue @ BackpressureSupport ( BackpressureKind . FULL ) @ SchedulerSupport ( SchedulerSupport . NONE ) public final Flowable < T > distinct ( ) { return distinct ( ( Function ) Functions . identity ( ) , Functions . < T > createHashSet ( ) ) ;


signature:
public class Flowable { /** * Returns a Flowable that emits all items emitted by the source Publisher that are distinct according
 * to a key selector function and based on { @ link Object # equals ( Object ) } comparison of the objects
 * returned by the key selector function .
 * < img width = " 640 " height = " 310 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / distinct . key . png " alt = " " >
 * It is recommended the keys ' class { @ code K } overrides the default { @ code Object . equals ( ) } and { @ link Object # hashCode ( ) } to provide
 * a meaningful comparison between the key objects as the default Java implementation only considers reference equivalence .
 * By default , { @ code distinct ( ) } uses an internal { @ link java . util . HashSet } per Subscriber to remember
 * previously seen keys and uses { @ link java . util . Set # add ( Object ) } returning { @ code false } as the
 * indicator for duplicates .
 * Note that this internal { @ code HashSet } may grow unbounded as keys won ' t be removed from it by
 * the operator . Therefore , using very long or infinite upstream ( with very distinct keys ) may lead
 * to { @ code OutOfMemoryError } .
 * Customizing the retention policy can happen only by providing a custom { @ link java . util . Collection } implementation
 * to the { @ link # distinct ( Function , Callable ) } overload .
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > The operator doesn ' t interfere with backpressure which is determined by the source { @ code Publisher } ' s
 * backpressure behavior . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code distinct } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param < K > the key type
 * @ param keySelector
 * a function that projects an emitted item to a key value that is used to decide whether an item
 * is distinct from another one or not
 * @ return a Flowable that emits those items emitted by the source Publisher that have distinct keys
 * @ see < a href = " http : / / reactivex . io / documentation / operators / distinct . html " > ReactiveX operators documentation : Distinct < / a >
 * @ see # distinct ( Function , Callable ) */
@ CheckReturnValue @ BackpressureSupport ( BackpressureKind . FULL ) @ SchedulerSupport ( SchedulerSupport . NONE ) public final < K > Flowable < T > distinct ( Function < ? super T , K > keySelector ) { } }

implementation: return distinct ( keySelector , Functions . < K > createHashSet ( ) ) ;


signature:
public class Flowable { /** * Returns a Flowable that emits all items emitted by the source Publisher that are distinct according
 * to a key selector function and based on { @ link Object # equals ( Object ) } comparison of the objects
 * returned by the key selector function .
 * < img width = " 640 " height = " 310 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / distinct . key . png " alt = " " >
 * It is recommended the keys ' class { @ code K } overrides the default { @ code Object . equals ( ) } and { @ link Object # hashCode ( ) } to provide
 * a meaningful comparison between the key objects as the default Java implementation only considers reference equivalence .
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > The operator doesn ' t interfere with backpressure which is determined by the source { @ code Publisher } ' s
 * backpressure behavior . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code distinct } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param < K > the key type
 * @ param keySelector
 * a function that projects an emitted item to a key value that is used to decide whether an item
 * is distinct from another one or not
 * @ param collectionSupplier
 * function called for each individual Subscriber to return a Collection subtype for holding the extracted
 * keys and whose add ( ) method ' s return indicates uniqueness .
 * @ return a Flowable that emits those items emitted by the source Publisher that have distinct keys
 * @ see < a href = " http : / / reactivex . io / documentation / operators / distinct . html " > ReactiveX operators documentation : Distinct < / a > */
@ CheckReturnValue @ BackpressureSupport ( BackpressureKind . FULL ) @ SchedulerSupport ( SchedulerSupport . NONE ) public final < K > Flowable < T > distinct ( Function < ? super T , K > keySelector , Callable < ? extends Collection < ? super K > > collectionSupplier ) { } }

implementation: ObjectHelper . requireNonNull ( keySelector , "keySelector is null" ) ; ObjectHelper . requireNonNull ( collectionSupplier , "collectionSupplier is null" ) ; return RxJavaPlugins . onAssembly ( new FlowableDistinct < T , K > ( this , keySelector , collectionSupplier ) ) ;


signature:
public class Flowable { /** * Returns a Flowable that emits all items emitted by the source Publisher that are distinct from their
 * immediate predecessors based on { @ link Object # equals ( Object ) } comparison .
 * < img width = " 640 " height = " 310 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / distinctUntilChanged . png " alt = " " >
 * It is recommended the elements ' class { @ code T } in the flow overrides the default { @ code Object . equals ( ) } to provide
 * a meaningful comparison between items as the default Java implementation only considers reference equivalence .
 * Alternatively , use the { @ link # distinctUntilChanged ( BiPredicate ) } overload and provide a comparison function
 * in case the class { @ code T } can ' t be overridden with custom { @ code equals ( ) } or the comparison itself
 * should happen on different terms or properties of the class { @ code T } .
 * Note that the operator always retains the latest item from upstream regardless of the comparison result
 * and uses it in the next comparison with the next upstream item .
 * Note that if element type { @ code T } in the flow is mutable , the comparison of the previous and current
 * item may yield unexpected results if the items are mutated externally . Common cases are mutable
 * { @ code CharSequence } s or { @ code List } s where the objects will actually have the same
 * references when they are modified and { @ code distinctUntilChanged } will evaluate subsequent items as same .
 * To avoid such situation , it is recommended that mutable data is converted to an immutable one ,
 * for example using { @ code map ( CharSequence : : toString ) } or { @ code map ( list - > Collections . unmodifiableList ( new ArrayList < > ( list ) ) ) } .
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > The operator doesn ' t interfere with backpressure which is determined by the source { @ code Publisher } ' s
 * backpressure behavior . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code distinctUntilChanged } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ return a Flowable that emits those items from the source Publisher that are distinct from their
 * immediate predecessors
 * @ see < a href = " http : / / reactivex . io / documentation / operators / distinct . html " > ReactiveX operators documentation : Distinct < / a >
 * @ see # distinctUntilChanged ( BiPredicate ) */
@ CheckReturnValue @ BackpressureSupport ( BackpressureKind . FULL ) @ SchedulerSupport ( SchedulerSupport . NONE ) public final Flowable < T > distinctUntilChanged ( ) { } }

implementation: return distinctUntilChanged ( Functions . identity ( ) ) ;


signature:
public class Flowable { /** * Returns a Flowable that emits all items emitted by the source Publisher that are distinct from their
 * immediate predecessors , according to a key selector function and based on { @ link Object # equals ( Object ) } comparison
 * of those objects returned by the key selector function .
 * < img width = " 640 " height = " 310 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / distinctUntilChanged . key . png " alt = " " >
 * It is recommended the keys ' class { @ code K } overrides the default { @ code Object . equals ( ) } to provide
 * a meaningful comparison between the key objects as the default Java implementation only considers reference equivalence .
 * Alternatively , use the { @ link # distinctUntilChanged ( BiPredicate ) } overload and provide a comparison function
 * in case the class { @ code K } can ' t be overridden with custom { @ code equals ( ) } or the comparison itself
 * should happen on different terms or properties of the item class { @ code T } ( for which the keys can be
 * derived via a similar selector ) .
 * Note that the operator always retains the latest key from upstream regardless of the comparison result
 * and uses it in the next comparison with the next key derived from the next upstream item .
 * Note that if element type { @ code T } in the flow is mutable , the comparison of the previous and current
 * item may yield unexpected results if the items are mutated externally . Common cases are mutable
 * { @ code CharSequence } s or { @ code List } s where the objects will actually have the same
 * references when they are modified and { @ code distinctUntilChanged } will evaluate subsequent items as same .
 * To avoid such situation , it is recommended that mutable data is converted to an immutable one ,
 * for example using { @ code map ( CharSequence : : toString ) } or { @ code map ( list - > Collections . unmodifiableList ( new ArrayList < > ( list ) ) ) } .
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > The operator doesn ' t interfere with backpressure which is determined by the source { @ code Publisher } ' s
 * backpressure behavior . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code distinctUntilChanged } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param < K > the key type
 * @ param keySelector
 * a function that projects an emitted item to a key value that is used to decide whether an item
 * is distinct from another one or not
 * @ return a Flowable that emits those items from the source Publisher whose keys are distinct from
 * those of their immediate predecessors
 * @ see < a href = " http : / / reactivex . io / documentation / operators / distinct . html " > ReactiveX operators documentation : Distinct < / a > */
@ CheckReturnValue @ BackpressureSupport ( BackpressureKind . FULL ) @ SchedulerSupport ( SchedulerSupport . NONE ) public final < K > Flowable < T > distinctUntilChanged ( Function < ? super T , K > keySelector ) { } }

implementation: ObjectHelper . requireNonNull ( keySelector , "keySelector is null" ) ; return RxJavaPlugins . onAssembly ( new FlowableDistinctUntilChanged < T , K > ( this , keySelector , ObjectHelper . equalsPredicate ( ) ) ) ;


signature:
public class Flowable { /** * Returns a Flowable that emits all items emitted by the source Publisher that are distinct from their
 * immediate predecessors when compared with each other via the provided comparator function .
 * < img width = " 640 " height = " 310 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / distinctUntilChanged . png " alt = " " >
 * Note that the operator always retains the latest item from upstream regardless of the comparison result
 * and uses it in the next comparison with the next upstream item .
 * Note that if element type { @ code T } in the flow is mutable , the comparison of the previous and current
 * item may yield unexpected results if the items are mutated externally . Common cases are mutable
 * { @ code CharSequence } s or { @ code List } s where the objects will actually have the same
 * references when they are modified and { @ code distinctUntilChanged } will evaluate subsequent items as same .
 * To avoid such situation , it is recommended that mutable data is converted to an immutable one ,
 * for example using { @ code map ( CharSequence : : toString ) } or { @ code map ( list - > Collections . unmodifiableList ( new ArrayList < > ( list ) ) ) } .
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > The operator doesn ' t interfere with backpressure which is determined by the source { @ code Publisher } ' s
 * backpressure behavior . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code distinctUntilChanged } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param comparer the function that receives the previous item and the current item and is
 * expected to return true if the two are equal , thus skipping the current value .
 * @ return a Flowable that emits those items from the source Publisher that are distinct from their
 * immediate predecessors
 * @ see < a href = " http : / / reactivex . io / documentation / operators / distinct . html " > ReactiveX operators documentation : Distinct < / a >
 * @ since 2.0 */
@ CheckReturnValue @ BackpressureSupport ( BackpressureKind . FULL ) @ SchedulerSupport ( SchedulerSupport . NONE ) public final Flowable < T > distinctUntilChanged ( BiPredicate < ? super T , ? super T > comparer ) { } }

implementation: ObjectHelper . requireNonNull ( comparer , "comparer is null" ) ; return RxJavaPlugins . onAssembly ( new FlowableDistinctUntilChanged < T , T > ( this , Functions . < T > identity ( ) , comparer ) ) ;


signature:
public class Flowable { /** * Calls the specified action after this Flowable signals onError or onCompleted or gets canceled by
 * the downstream .
 * < p > In case of a race between a terminal event and a cancellation , the provided { @ code onFinally } action
 * is executed once per subscription .
 * < p > Note that the { @ code onFinally } action is shared between subscriptions and as such
 * should be thread - safe .
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > The operator doesn ' t interfere with backpressure which is determined by the source { @ code Publisher } ' s backpressure
 * behavior . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code doFinally } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < dt > < b > Operator - fusion : < / b > < / dt >
 * < dd > This operator supports normal and conditional Subscribers as well as boundary - limited
 * synchronous or asynchronous queue - fusion . < / dd >
 * < / dl >
 * < p > History : 2.0.1 - experimental
 * @ param onFinally the action called when this Flowable terminates or gets canceled
 * @ return the new Flowable instance
 * @ since 2.1 */
@ CheckReturnValue @ BackpressureSupport ( BackpressureKind . PASS_THROUGH ) @ SchedulerSupport ( SchedulerSupport . NONE ) public final Flowable < T > doFinally ( Action onFinally ) { } }

implementation: ObjectHelper . requireNonNull ( onFinally , "onFinally is null" ) ; return RxJavaPlugins . onAssembly ( new FlowableDoFinally < T > ( this , onFinally ) ) ;


signature:
public class Flowable { /** * Calls the specified consumer with the current item after this item has been emitted to the downstream .
 * < p > Note that the { @ code onAfterNext } action is shared between subscriptions and as such
 * should be thread - safe .
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > The operator doesn ' t interfere with backpressure which is determined by the source { @ code Publisher } ' s backpressure
 * behavior . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code doAfterNext } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < dt > < b > Operator - fusion : < / b > < / dt >
 * < dd > This operator supports normal and conditional Subscribers as well as boundary - limited
 * synchronous or asynchronous queue - fusion . < / dd >
 * < / dl >
 * < p > History : 2.0.1 - experimental
 * @ param onAfterNext the Consumer that will be called after emitting an item from upstream to the downstream
 * @ return the new Flowable instance
 * @ since 2.1 */
@ CheckReturnValue @ BackpressureSupport ( BackpressureKind . PASS_THROUGH ) @ SchedulerSupport ( SchedulerSupport . NONE ) public final Flowable < T > doAfterNext ( Consumer < ? super T > onAfterNext ) { } }

implementation: ObjectHelper . requireNonNull ( onAfterNext , "onAfterNext is null" ) ; return RxJavaPlugins . onAssembly ( new FlowableDoAfterNext < T > ( this , onAfterNext ) ) ;


signature:
public class Flowable { /** * Registers an { @ link Action } to be called when this Publisher invokes either
 * { @ link Subscriber # onComplete onComplete } or { @ link Subscriber # onError onError } .
 * < img width = " 640 " height = " 310 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / finallyDo . png " alt = " " >
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > The operator doesn ' t interfere with backpressure which is determined by the source { @ code Publisher } ' s backpressure
 * behavior . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code doAfterTerminate } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param onAfterTerminate
 * an { @ link Action } to be invoked when the source Publisher finishes
 * @ return a Flowable that emits the same items as the source Publisher , then invokes the
 * { @ link Action }
 * @ see < a href = " http : / / reactivex . io / documentation / operators / do . html " > ReactiveX operators documentation : Do < / a >
 * @ see # doOnTerminate ( Action ) */
@ CheckReturnValue @ BackpressureSupport ( BackpressureKind . PASS_THROUGH ) @ SchedulerSupport ( SchedulerSupport . NONE ) public final Flowable < T > doAfterTerminate ( Action onAfterTerminate ) { } }

implementation: return doOnEach ( Functions . emptyConsumer ( ) , Functions . emptyConsumer ( ) , Functions . EMPTY_ACTION , onAfterTerminate ) ;


signature:
public class Flowable { /** * Calls the cancel { @ code Action } if the downstream cancels the sequence .
 * The action is shared between subscriptions and thus may be called concurrently from multiple
 * threads ; the action must be thread - safe .
 * If the action throws a runtime exception , that exception is rethrown by the { @ code onCancel ( ) } call ,
 * sometimes as a { @ code CompositeException } if there were multiple exceptions along the way .
 * Note that terminal events trigger the action unless the { @ code Publisher } is subscribed to via { @ code unsafeSubscribe ( ) } .
 * < img width = " 640 " height = " 310 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / doOnUnsubscribe . png " alt = " " >
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > { @ code doOnCancel } does not interact with backpressure requests or value delivery ; backpressure
 * behavior is preserved between its upstream and its downstream . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code doOnCancel } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param onCancel
 * the action that gets called when the source { @ code Publisher } ' s Subscription is canceled
 * @ return the source { @ code Publisher } modified so as to call this Action when appropriate
 * @ see < a href = " http : / / reactivex . io / documentation / operators / do . html " > ReactiveX operators documentation : Do < / a > */
@ CheckReturnValue @ BackpressureSupport ( BackpressureKind . PASS_THROUGH ) @ SchedulerSupport ( SchedulerSupport . NONE ) public final Flowable < T > doOnCancel ( Action onCancel ) { } }

implementation: return doOnLifecycle ( Functions . emptyConsumer ( ) , Functions . EMPTY_LONG_CONSUMER , onCancel ) ;


signature:
public class Flowable { /** * Modifies the source Publisher so that it invokes an action when it calls { @ code onComplete } .
 * < img width = " 640 " height = " 305 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / doOnComplete . png " alt = " " >
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > The operator doesn ' t interfere with backpressure which is determined by the source { @ code Publisher } ' s
 * backpressure behavior . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code doOnComplete } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param onComplete
 * the action to invoke when the source Publisher calls { @ code onComplete }
 * @ return the source Publisher with the side - effecting behavior applied
 * @ see < a href = " http : / / reactivex . io / documentation / operators / do . html " > ReactiveX operators documentation : Do < / a > */
@ CheckReturnValue @ BackpressureSupport ( BackpressureKind . PASS_THROUGH ) @ SchedulerSupport ( SchedulerSupport . NONE ) public final Flowable < T > doOnComplete ( Action onComplete ) { } }

implementation: return doOnEach ( Functions . emptyConsumer ( ) , Functions . emptyConsumer ( ) , onComplete , Functions . EMPTY_ACTION ) ;


signature:
public class Flowable { /** * Calls the appropriate onXXX consumer ( shared between all subscribers ) whenever a signal with the same type
 * passes through , before forwarding them to downstream .
 * < img width = " 640 " height = " 310 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / doOnEach . png " alt = " " >
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > The operator doesn ' t interfere with backpressure which is determined by the source { @ code Publisher } ' s
 * backpressure behavior . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code doOnEach } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ return the source Publisher with the side - effecting behavior applied
 * @ see < a href = " http : / / reactivex . io / documentation / operators / do . html " > ReactiveX operators documentation : Do < / a > */
@ CheckReturnValue @ NonNull @ BackpressureSupport ( BackpressureKind . PASS_THROUGH ) @ SchedulerSupport ( SchedulerSupport . NONE ) private Flowable < T > doOnEach ( Consumer < ? super T > onNext , Consumer < ? super Throwable > onError , Action onComplete , Action onAfterTerminate ) { } }

implementation: ObjectHelper . requireNonNull ( onNext , "onNext is null" ) ; ObjectHelper . requireNonNull ( onError , "onError is null" ) ; ObjectHelper . requireNonNull ( onComplete , "onComplete is null" ) ; ObjectHelper . requireNonNull ( onAfterTerminate , "onAfterTerminate is null" ) ; return RxJavaPlugins . onAssembly ( new FlowableDoOnEach < T > ( this , onNext , onError , onComplete , onAfterTerminate ) ) ;


signature:
public class Flowable { /** * Modifies the source Publisher so that it invokes an action for each item it emits .
 * < img width = " 640 " height = " 310 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / doOnEach . png " alt = " " >
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > The operator doesn ' t interfere with backpressure which is determined by the source { @ code Publisher } ' s
 * backpressure behavior . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code doOnEach } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param onNotification
 * the action to invoke for each item emitted by the source Publisher
 * @ return the source Publisher with the side - effecting behavior applied
 * @ see < a href = " http : / / reactivex . io / documentation / operators / do . html " > ReactiveX operators documentation : Do < / a > */
@ CheckReturnValue @ NonNull @ BackpressureSupport ( BackpressureKind . PASS_THROUGH ) @ SchedulerSupport ( SchedulerSupport . NONE ) public final Flowable < T > doOnEach ( final Consumer < ? super Notification < T > > onNotification ) { } }

implementation: ObjectHelper . requireNonNull ( onNotification , "onNotification is null" ) ; return doOnEach ( Functions . notificationOnNext ( onNotification ) , Functions . notificationOnError ( onNotification ) , Functions . notificationOnComplete ( onNotification ) , Functions . EMPTY_ACTION ) ;


signature:
public class Flowable { /** * Modifies the source Publisher so that it notifies a Subscriber for each item and terminal event it emits .
 * In case the { @ code onError } of the supplied Subscriber throws , the downstream will receive a composite
 * exception containing the original exception and the exception thrown by { @ code onError } . If either the
 * { @ code onNext } or the { @ code onComplete } method of the supplied Subscriber throws , the downstream will be
 * terminated and will receive this thrown exception .
 * < img width = " 640 " height = " 310 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / doOnEach . o . png " alt = " " >
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > The operator doesn ' t interfere with backpressure which is determined by the source { @ code Publisher } ' s
 * backpressure behavior . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code doOnEach } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param subscriber
 * the Subscriber to be notified about onNext , onError and onComplete events on its
 * respective methods before the actual downstream Subscriber gets notified .
 * @ return the source Publisher with the side - effecting behavior applied
 * @ see < a href = " http : / / reactivex . io / documentation / operators / do . html " > ReactiveX operators documentation : Do < / a > */
@ CheckReturnValue @ NonNull @ BackpressureSupport ( BackpressureKind . PASS_THROUGH ) @ SchedulerSupport ( SchedulerSupport . NONE ) public final Flowable < T > doOnEach ( final Subscriber < ? super T > subscriber ) { } }

implementation: ObjectHelper . requireNonNull ( subscriber , "subscriber is null" ) ; return doOnEach ( FlowableInternalHelper . subscriberOnNext ( subscriber ) , FlowableInternalHelper . subscriberOnError ( subscriber ) , FlowableInternalHelper . subscriberOnComplete ( subscriber ) , Functions . EMPTY_ACTION ) ;


signature:
public class Flowable { /** * Modifies the source Publisher so that it invokes an action if it calls { @ code onError } .
 * In case the { @ code onError } action throws , the downstream will receive a composite exception containing
 * the original exception and the exception thrown by { @ code onError } .
 * < img width = " 640 " height = " 305 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / doOnError . png " alt = " " >
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > The operator doesn ' t interfere with backpressure which is determined by the source { @ code Publisher } ' s
 * backpressure behavior . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code doOnError } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param onError
 * the action to invoke if the source Publisher calls { @ code onError }
 * @ return the source Publisher with the side - effecting behavior applied
 * @ see < a href = " http : / / reactivex . io / documentation / operators / do . html " > ReactiveX operators documentation : Do < / a > */
@ CheckReturnValue @ BackpressureSupport ( BackpressureKind . PASS_THROUGH ) @ SchedulerSupport ( SchedulerSupport . NONE ) public final Flowable < T > doOnError ( Consumer < ? super Throwable > onError ) { } }

implementation: return doOnEach ( Functions . emptyConsumer ( ) , onError , Functions . EMPTY_ACTION , Functions . EMPTY_ACTION ) ;


signature:
public class Flowable { /** * Modifies the source Publisher so that it invokes an action when it calls { @ code onNext } .
 * < img width = " 640 " height = " 310 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / doOnNext . png " alt = " " >
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > The operator doesn ' t interfere with backpressure which is determined by the source { @ code Publisher } ' s
 * backpressure behavior . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code doOnNext } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param onNext
 * the action to invoke when the source Publisher calls { @ code onNext }
 * @ return the source Publisher with the side - effecting behavior applied
 * @ see < a href = " http : / / reactivex . io / documentation / operators / do . html " > ReactiveX operators documentation : Do < / a > */
@ CheckReturnValue @ BackpressureSupport ( BackpressureKind . PASS_THROUGH ) @ SchedulerSupport ( SchedulerSupport . NONE ) public final Flowable < T > doOnNext ( Consumer < ? super T > onNext ) { } }

implementation: return doOnEach ( onNext , Functions . emptyConsumer ( ) , Functions . EMPTY_ACTION , Functions . EMPTY_ACTION ) ;


signature:
public class Flowable { /** * Modifies the source { @ code Publisher } so that it invokes the given action when it receives a
 * request for more items .
 * < b > Note : < / b > This operator is for tracing the internal behavior of back - pressure request
 * patterns and generally intended for debugging use .
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > The operator doesn ' t interfere with backpressure which is determined by the source { @ code Publisher } ' s
 * backpressure behavior . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code doOnRequest } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param onRequest
 * the action that gets called when a Subscriber requests items from this
 * { @ code Publisher }
 * @ return the source { @ code Publisher } modified so as to call this Action when appropriate
 * @ see < a href = " http : / / reactivex . io / documentation / operators / do . html " > ReactiveX operators
 * documentation : Do < / a >
 * @ since 2.0 */
@ CheckReturnValue @ BackpressureSupport ( BackpressureKind . PASS_THROUGH ) @ SchedulerSupport ( SchedulerSupport . NONE ) public final Flowable < T > doOnRequest ( LongConsumer onRequest ) { } }

implementation: return doOnLifecycle ( Functions . emptyConsumer ( ) , onRequest , Functions . EMPTY_ACTION ) ;


signature:
public class Flowable { /** * Modifies the source { @ code Publisher } so that it invokes the given action when it is subscribed from
 * its subscribers . Each subscription will result in an invocation of the given action except when the
 * source { @ code Publisher } is reference counted , in which case the source { @ code Publisher } will invoke
 * the given action for the first subscription .
 * < img width = " 640 " height = " 390 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / doOnSubscribe . png " alt = " " >
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > The operator doesn ' t interfere with backpressure which is determined by the source { @ code Publisher } ' s
 * backpressure behavior . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code doOnSubscribe } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param onSubscribe
 * the Consumer that gets called when a Subscriber subscribes to the current { @ code Flowable }
 * @ return the source { @ code Publisher } modified so as to call this Consumer when appropriate
 * @ see < a href = " http : / / reactivex . io / documentation / operators / do . html " > ReactiveX operators documentation : Do < / a > */
@ CheckReturnValue @ BackpressureSupport ( BackpressureKind . PASS_THROUGH ) @ SchedulerSupport ( SchedulerSupport . NONE ) public final Flowable < T > doOnSubscribe ( Consumer < ? super Subscription > onSubscribe ) { } }

implementation: return doOnLifecycle ( onSubscribe , Functions . EMPTY_LONG_CONSUMER , Functions . EMPTY_ACTION ) ;


signature:
public class Flowable { /** * Modifies the source Publisher so that it invokes an action when it calls { @ code onComplete } or
 * { @ code onError } .
 * < img width = " 640 " height = " 305 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / doOnTerminate . png " alt = " " >
 * This differs from { @ code doAfterTerminate } in that this happens < em > before < / em > the { @ code onComplete } or
 * { @ code onError } notification .
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > The operator doesn ' t interfere with backpressure which is determined by the source { @ code Publisher } ' s
 * backpressure behavior . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code doOnTerminate } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param onTerminate
 * the action to invoke when the source Publisher calls { @ code onComplete } or { @ code onError }
 * @ return the source Publisher with the side - effecting behavior applied
 * @ see < a href = " http : / / reactivex . io / documentation / operators / do . html " > ReactiveX operators documentation : Do < / a >
 * @ see # doAfterTerminate ( Action ) */
@ CheckReturnValue @ BackpressureSupport ( BackpressureKind . PASS_THROUGH ) @ SchedulerSupport ( SchedulerSupport . NONE ) public final Flowable < T > doOnTerminate ( final Action onTerminate ) { } }

implementation: return doOnEach ( Functions . emptyConsumer ( ) , Functions . actionConsumer ( onTerminate ) , onTerminate , Functions . EMPTY_ACTION ) ;


signature:
public class Flowable { /** * Returns a Maybe that emits the single item at a specified index in a sequence of emissions from
 * this Flowable or completes if this Flowable sequence has fewer elements than index .
 * < img width = " 640 " height = " 310 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / elementAt . png " alt = " " >
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > The operator honors backpressure from downstream and consumes the source { @ code Publisher } in an unbounded manner
 * ( i . e . , no backpressure applied to it ) . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code elementAt } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param index
 * the zero - based index of the item to retrieve
 * @ return a Maybe that emits a single item : the item at the specified position in the sequence of
 * those emitted by the source Publisher
 * @ see < a href = " http : / / reactivex . io / documentation / operators / elementat . html " > ReactiveX operators documentation : ElementAt < / a > */
@ CheckReturnValue @ BackpressureSupport ( BackpressureKind . UNBOUNDED_IN ) @ SchedulerSupport ( SchedulerSupport . NONE ) public final Maybe < T > elementAt ( long index ) { } }

implementation: if ( index < 0 ) { throw new IndexOutOfBoundsException ( "index >= 0 required but it was " + index ) ; } return RxJavaPlugins . onAssembly ( new FlowableElementAtMaybe < T > ( this , index ) ) ;


signature:
public class Flowable { /** * Returns a Single that emits the item found at a specified index in a sequence of emissions from
 * this Flowable or signals a { @ link NoSuchElementException } if this Flowable has fewer elements than index .
 * < img width = " 640 " height = " 310 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / elementAtOrDefault . png " alt = " " >
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > The operator honors backpressure from downstream and consumes the source { @ code Publisher } in an unbounded manner
 * ( i . e . , no backpressure applied to it ) . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code elementAtOrError } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param index
 * the zero - based index of the item to retrieve
 * @ return a Single that emits the item at the specified position in the sequence emitted by the source
 * Publisher , or the default item if that index is outside the bounds of the source sequence
 * @ throws IndexOutOfBoundsException
 * if { @ code index } is less than 0
 * @ see < a href = " http : / / reactivex . io / documentation / operators / elementat . html " > ReactiveX operators documentation : ElementAt < / a > */
@ CheckReturnValue @ BackpressureSupport ( BackpressureKind . UNBOUNDED_IN ) @ SchedulerSupport ( SchedulerSupport . NONE ) public final Single < T > elementAtOrError ( long index ) { } }

implementation: if ( index < 0 ) { throw new IndexOutOfBoundsException ( "index >= 0 required but it was " + index ) ; } return RxJavaPlugins . onAssembly ( new FlowableElementAtSingle < T > ( this , index , null ) ) ;


signature:
public class Flowable { /** * Filters items emitted by a Publisher by only emitting those that satisfy a specified predicate .
 * < img width = " 640 " height = " 310 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / filter . png " alt = " " >
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > The operator doesn ' t interfere with backpressure which is determined by the source { @ code Publisher } ' s backpressure
 * behavior . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code filter } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param predicate
 * a function that evaluates each item emitted by the source Publisher , returning { @ code true }
 * if it passes the filter
 * @ return a Flowable that emits only those items emitted by the source Publisher that the filter
 * evaluates as { @ code true }
 * @ see < a href = " http : / / reactivex . io / documentation / operators / filter . html " > ReactiveX operators documentation : Filter < / a > */
@ CheckReturnValue @ NonNull @ BackpressureSupport ( BackpressureKind . PASS_THROUGH ) @ SchedulerSupport ( SchedulerSupport . NONE ) public final Flowable < T > filter ( Predicate < ? super T > predicate ) { } }

implementation: ObjectHelper . requireNonNull ( predicate , "predicate is null" ) ; return RxJavaPlugins . onAssembly ( new FlowableFilter < T > ( this , predicate ) ) ;


signature:
public class Flowable { /** * Returns a Maybe that emits only the very first item emitted by this Flowable or
 * completes if this Flowable is empty .
 * < img width = " 640 " height = " 237 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / firstElement . m . png " alt = " " >
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > The operator honors backpressure from downstream and consumes the source { @ code Publisher } in an
 * unbounded manner ( i . e . , without applying backpressure ) . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code firstElement } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ return the new Maybe instance
 * @ see < a href = " http : / / reactivex . io / documentation / operators / first . html " > ReactiveX operators documentation : First < / a > */
@ CheckReturnValue @ BackpressureSupport ( BackpressureKind . SPECIAL ) // take may trigger UNBOUNDED _ IN
@ SchedulerSupport ( SchedulerSupport . NONE ) public final Maybe < T > firstElement ( ) { } }

implementation: return elementAt ( 0 ) ;


signature:
public class Flowable { /** * Returns a Single that emits only the very first item emitted by this Flowable , or a default
 * item if this Flowable completes without emitting anything .
 * < img width = " 640 " height = " 305 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / first . s . png " alt = " " >
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > The operator honors backpressure from downstream and consumes the source { @ code Publisher } in an
 * unbounded manner ( i . e . , without applying backpressure ) . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code first } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param defaultItem
 * the default item to emit if the source Publisher doesn ' t emit anything
 * @ return a Single that emits only the very first item from the source , or a default item if the
 * source Publisher completes without emitting any items
 * @ see < a href = " http : / / reactivex . io / documentation / operators / first . html " > ReactiveX operators documentation : First < / a > */
@ CheckReturnValue @ BackpressureSupport ( BackpressureKind . SPECIAL ) // take may trigger UNBOUNDED _ IN
@ SchedulerSupport ( SchedulerSupport . NONE ) public final Single < T > first ( T defaultItem ) { } }

implementation: return elementAt ( 0 , defaultItem ) ;


signature:
public class Flowable { /** * Returns a Single that emits only the very first item emitted by this Flowable or
 * signals a { @ link NoSuchElementException } if this Flowable is empty .
 * < img width = " 640 " height = " 237 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / firstOrError . png " alt = " " >
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > The operator honors backpressure from downstream and consumes the source { @ code Publisher } in an
 * unbounded manner ( i . e . , without applying backpressure ) . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code firstOrError } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ return the new Single instance
 * @ see < a href = " http : / / reactivex . io / documentation / operators / first . html " > ReactiveX operators documentation : First < / a > */
@ CheckReturnValue @ BackpressureSupport ( BackpressureKind . SPECIAL ) // take may trigger UNBOUNDED _ IN
@ SchedulerSupport ( SchedulerSupport . NONE ) public final Single < T > firstOrError ( ) { } }

implementation: return elementAtOrError ( 0 ) ;


signature:
public class Flowable { /** * Returns a Flowable that emits items based on applying a function that you supply to each item emitted
 * by the source Publisher , where that function returns a Publisher , and then merging those resulting
 * Publishers and emitting the results of this merger , while limiting the maximum number of concurrent
 * subscriptions to these Publishers .
 * < ! - - < img width = " 640 " height = " 310 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / flatMap . png " alt = " " > - - >
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > The operator honors backpressure from downstream . The upstream Flowable is consumed
 * in a bounded manner ( up to { @ code maxConcurrency } outstanding request amount for items ) .
 * The inner { @ code Publisher } s are expected to honor backpressure ; if violated ,
 * the operator < em > may < / em > signal { @ code MissingBackpressureException } . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code flatMap } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param < R > the value type of the inner Publishers and the output type
 * @ param mapper
 * a function that , when applied to an item emitted by the source Publisher , returns a
 * Publisher
 * @ param maxConcurrency
 * the maximum number of Publishers that may be subscribed to concurrently
 * @ param delayErrors
 * if true , exceptions from the current Flowable and all inner Publishers are delayed until all of them terminate
 * if false , the first one signaling an exception will terminate the whole sequence immediately
 * @ param bufferSize
 * the number of elements to prefetch from each inner Publisher
 * @ return a Flowable that emits the result of applying the transformation function to each item emitted
 * by the source Publisher and merging the results of the Publishers obtained from this
 * transformation
 * @ see < a href = " http : / / reactivex . io / documentation / operators / flatmap . html " > ReactiveX operators documentation : FlatMap < / a >
 * @ since 2.0 */
@ CheckReturnValue @ NonNull @ BackpressureSupport ( BackpressureKind . FULL ) @ SchedulerSupport ( SchedulerSupport . NONE ) public final < R > Flowable < R > flatMap ( Function < ? super T , ? extends Publisher < ? extends R > > mapper , boolean delayErrors , int maxConcurrency , int bufferSize ) { } }

implementation: ObjectHelper . requireNonNull ( mapper , "mapper is null" ) ; ObjectHelper . verifyPositive ( maxConcurrency , "maxConcurrency" ) ; ObjectHelper . verifyPositive ( bufferSize , "bufferSize" ) ; if ( this instanceof ScalarCallable ) { @ SuppressWarnings ( "unchecked" ) T v = ( ( ScalarCallable < T > ) this ) . call ( ) ; if ( v == null ) { return empty ( ) ; } return FlowableScalarXMap . scalarXMap ( v , mapper ) ; } return RxJavaPlugins . onAssembly ( new FlowableFlatMap < T , R > ( this , mapper , delayErrors , maxConcurrency , bufferSize ) ) ;


signature:
public class Flowable { /** * Returns a Flowable that applies a function to each item emitted or notification raised by the source
 * Publisher and then flattens the Publishers returned from these functions and emits the resulting items .
 * < img width = " 640 " height = " 410 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / mergeMap . nce . png " alt = " " >
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > The operator honors backpressure from downstream . The upstream Flowable is consumed
 * in a bounded manner ( up to { @ link # bufferSize ( ) } outstanding request amount for items ) .
 * The inner { @ code Publisher } s are expected to honor backpressure ; if violated ,
 * the operator < em > may < / em > signal { @ code MissingBackpressureException } . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code flatMap } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param < R >
 * the result type
 * @ param onNextMapper
 * a function that returns a Publisher to merge for each item emitted by the source Publisher
 * @ param onErrorMapper
 * a function that returns a Publisher to merge for an onError notification from the source
 * Publisher
 * @ param onCompleteSupplier
 * a function that returns a Publisher to merge for an onComplete notification from the source
 * Publisher
 * @ return a Flowable that emits the results of merging the Publishers returned from applying the
 * specified functions to the emissions and notifications of the source Publisher
 * @ see < a href = " http : / / reactivex . io / documentation / operators / flatmap . html " > ReactiveX operators documentation : FlatMap < / a > */
@ CheckReturnValue @ NonNull @ BackpressureSupport ( BackpressureKind . FULL ) @ SchedulerSupport ( SchedulerSupport . NONE ) public final < R > Flowable < R > flatMap ( Function < ? super T , ? extends Publisher < ? extends R > > onNextMapper , Function < ? super Throwable , ? extends Publisher < ? extends R > > onErrorMapper , Callable < ? extends Publisher < ? extends R > > onCompleteSupplier ) { } }

implementation: ObjectHelper . requireNonNull ( onNextMapper , "onNextMapper is null" ) ; ObjectHelper . requireNonNull ( onErrorMapper , "onErrorMapper is null" ) ; ObjectHelper . requireNonNull ( onCompleteSupplier , "onCompleteSupplier is null" ) ; return merge ( new FlowableMapNotification < T , Publisher < ? extends R > > ( this , onNextMapper , onErrorMapper , onCompleteSupplier ) ) ;


signature:
public class Flowable { /** * Returns a Flowable that emits the results of a specified function to the pair of values emitted by the
 * source Publisher and a specified collection Publisher , while limiting the maximum number of concurrent
 * subscriptions to these Publishers .
 * < ! - - < img width = " 640 " height = " 390 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / mergeMap . r . png " alt = " " > - - >
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > The operator honors backpressure from downstream . The upstream Flowable is consumed
 * in a bounded manner ( up to { @ code maxConcurrency } outstanding request amount for items ) .
 * The inner { @ code Publisher } s are expected to honor backpressure ; if violated ,
 * the operator < em > may < / em > signal { @ code MissingBackpressureException } . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code flatMap } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param < U >
 * the type of items emitted by the inner Publishers
 * @ param < R >
 * the type of items emitted by the combiner function
 * @ param mapper
 * a function that returns a Publisher for each item emitted by the source Publisher
 * @ param combiner
 * a function that combines one item emitted by each of the source and collection Publishers and
 * returns an item to be emitted by the resulting Publisher
 * @ param maxConcurrency
 * the maximum number of Publishers that may be subscribed to concurrently
 * @ param delayErrors
 * if true , exceptions from the current Flowable and all inner Publishers are delayed until all of them terminate
 * if false , the first one signaling an exception will terminate the whole sequence immediately
 * @ param bufferSize
 * the number of elements to prefetch from the inner Publishers .
 * @ return a Flowable that emits the results of applying a function to a pair of values emitted by the
 * source Publisher and the collection Publisher
 * @ see < a href = " http : / / reactivex . io / documentation / operators / flatmap . html " > ReactiveX operators documentation : FlatMap < / a >
 * @ since 2.0 */
@ CheckReturnValue @ NonNull @ BackpressureSupport ( BackpressureKind . FULL ) @ SchedulerSupport ( SchedulerSupport . NONE ) public final < U , R > Flowable < R > flatMap ( final Function < ? super T , ? extends Publisher < ? extends U > > mapper , final BiFunction < ? super T , ? super U , ? extends R > combiner , boolean delayErrors , int maxConcurrency , int bufferSize ) { } }

implementation: ObjectHelper . requireNonNull ( mapper , "mapper is null" ) ; ObjectHelper . requireNonNull ( combiner , "combiner is null" ) ; ObjectHelper . verifyPositive ( maxConcurrency , "maxConcurrency" ) ; ObjectHelper . verifyPositive ( bufferSize , "bufferSize" ) ; return flatMap ( FlowableInternalHelper . flatMapWithCombiner ( mapper , combiner ) , delayErrors , maxConcurrency , bufferSize ) ;


signature:
public class Flowable { /** * Maps each element of the upstream Flowable into CompletableSources , subscribes to them and
 * waits until the upstream and all CompletableSources complete .
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > The operator consumes the upstream in an unbounded manner . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code flatMapCompletable } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param mapper the function that received each source value and transforms them into CompletableSources .
 * @ return the new Completable instance */
@ CheckReturnValue @ BackpressureSupport ( BackpressureKind . UNBOUNDED_IN ) @ SchedulerSupport ( SchedulerSupport . NONE ) public final Completable flatMapCompletable ( Function < ? super T , ? extends CompletableSource > mapper ) { } }

implementation: return flatMapCompletable ( mapper , false , Integer . MAX_VALUE ) ;


signature:
public class Flowable { /** * Maps each element of the upstream Flowable into CompletableSources , subscribes to them and
 * waits until the upstream and all CompletableSources complete , optionally delaying all errors .
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > If { @ code maxConcurrency = = Integer . MAX _ VALUE } the operator consumes the upstream in an unbounded manner .
 * Otherwise , the operator expects the upstream to honor backpressure . If the upstream doesn ' t support backpressure
 * the operator behaves as if { @ code maxConcurrency = = Integer . MAX _ VALUE } was used . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code flatMapCompletable } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param mapper the function that received each source value and transforms them into CompletableSources .
 * @ param delayErrors if true errors from the upstream and inner CompletableSources are delayed until each of them
 * terminates .
 * @ param maxConcurrency the maximum number of active subscriptions to the CompletableSources .
 * @ return the new Completable instance */
@ CheckReturnValue @ NonNull @ BackpressureSupport ( BackpressureKind . UNBOUNDED_IN ) @ SchedulerSupport ( SchedulerSupport . NONE ) public final Completable flatMapCompletable ( Function < ? super T , ? extends CompletableSource > mapper , boolean delayErrors , int maxConcurrency ) { } }

implementation: ObjectHelper . requireNonNull ( mapper , "mapper is null" ) ; ObjectHelper . verifyPositive ( maxConcurrency , "maxConcurrency" ) ; return RxJavaPlugins . onAssembly ( new FlowableFlatMapCompletableCompletable < T > ( this , mapper , delayErrors , maxConcurrency ) ) ;


signature:
public class Flowable { /** * Maps each element of the upstream Flowable into MaybeSources , subscribes to all of them
 * and merges their onSuccess values , in no particular order , into a single Flowable sequence .
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > The operator consumes the upstream in an unbounded manner . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code flatMapMaybe } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param < R > the result value type
 * @ param mapper the function that received each source value and transforms them into MaybeSources .
 * @ return the new Flowable instance */
@ CheckReturnValue @ BackpressureSupport ( BackpressureKind . UNBOUNDED_IN ) @ SchedulerSupport ( SchedulerSupport . NONE ) public final < R > Flowable < R > flatMapMaybe ( Function < ? super T , ? extends MaybeSource < ? extends R > > mapper ) { } }

implementation: return flatMapMaybe ( mapper , false , Integer . MAX_VALUE ) ;


signature:
public class Flowable { /** * Maps each element of the upstream Flowable into SingleSources , subscribes to all of them
 * and merges their onSuccess values , in no particular order , into a single Flowable sequence .
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > The operator consumes the upstream in an unbounded manner . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code flatMapSingle } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param < R > the result value type
 * @ param mapper the function that received each source value and transforms them into SingleSources .
 * @ return the new Flowable instance */
@ CheckReturnValue @ BackpressureSupport ( BackpressureKind . UNBOUNDED_IN ) @ SchedulerSupport ( SchedulerSupport . NONE ) public final < R > Flowable < R > flatMapSingle ( Function < ? super T , ? extends SingleSource < ? extends R > > mapper ) { } }

implementation: return flatMapSingle ( mapper , false , Integer . MAX_VALUE ) ;


signature:
public class Flowable { /** * Maps each element of the upstream Flowable into SingleSources , subscribes to at most
 * { @ code maxConcurrency } SingleSources at a time and merges their onSuccess values ,
 * in no particular order , into a single Flowable sequence , optionally delaying all errors .
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > If { @ code maxConcurrency = = Integer . MAX _ VALUE } the operator consumes the upstream in an unbounded manner .
 * Otherwise , the operator expects the upstream to honor backpressure . If the upstream doesn ' t support backpressure
 * the operator behaves as if { @ code maxConcurrency = = Integer . MAX _ VALUE } was used . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code flatMapSingle } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param < R > the result value type
 * @ param mapper the function that received each source value and transforms them into SingleSources .
 * @ param delayErrors if true errors from the upstream and inner SingleSources are delayed until each of them
 * terminates .
 * @ param maxConcurrency the maximum number of active subscriptions to the SingleSources .
 * @ return the new Flowable instance */
@ CheckReturnValue @ NonNull @ BackpressureSupport ( BackpressureKind . UNBOUNDED_IN ) @ SchedulerSupport ( SchedulerSupport . NONE ) public final < R > Flowable < R > flatMapSingle ( Function < ? super T , ? extends SingleSource < ? extends R > > mapper , boolean delayErrors , int maxConcurrency ) { } }

implementation: ObjectHelper . requireNonNull ( mapper , "mapper is null" ) ; ObjectHelper . verifyPositive ( maxConcurrency , "maxConcurrency" ) ; return RxJavaPlugins . onAssembly ( new FlowableFlatMapSingle < T , R > ( this , mapper , delayErrors , maxConcurrency ) ) ;


signature:
public class Flowable { /** * Subscribes to the { @ link Publisher } and receives notifications for each element .
 * Alias to { @ link # subscribe ( Consumer ) }
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > The operator consumes the source { @ code Publisher } in an unbounded manner ( i . e . , no
 * backpressure is applied to it ) . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code forEach } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param onNext
 * { @ link Consumer } to execute for each item .
 * @ return
 * a Disposable that allows canceling an asynchronous sequence
 * @ throws NullPointerException
 * if { @ code onNext } is null
 * @ see < a href = " http : / / reactivex . io / documentation / operators / subscribe . html " > ReactiveX operators documentation : Subscribe < / a > */
@ CheckReturnValue @ BackpressureSupport ( BackpressureKind . NONE ) @ SchedulerSupport ( SchedulerSupport . NONE ) public final Disposable forEach ( Consumer < ? super T > onNext ) { } }

implementation: return subscribe ( onNext ) ;


signature:
public class Flowable { /** * Subscribes to the { @ link Publisher } and receives notifications for each element until the
 * onNext Predicate returns false .
 * If the Flowable emits an error , it is wrapped into an
 * { @ link io . reactivex . exceptions . OnErrorNotImplementedException OnErrorNotImplementedException }
 * and routed to the RxJavaPlugins . onError handler .
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > The operator consumes the source { @ code Publisher } in an unbounded manner ( i . e . , no
 * backpressure is applied to it ) . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code forEachWhile } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param onNext
 * { @ link Predicate } to execute for each item .
 * @ return
 * a { @ link Disposable } that allows canceling an asynchronous sequence
 * @ throws NullPointerException
 * if { @ code onNext } is null
 * @ see < a href = " http : / / reactivex . io / documentation / operators / subscribe . html " > ReactiveX operators documentation : Subscribe < / a > */
@ CheckReturnValue @ BackpressureSupport ( BackpressureKind . NONE ) @ SchedulerSupport ( SchedulerSupport . NONE ) public final Disposable forEachWhile ( Predicate < ? super T > onNext ) { } }

implementation: return forEachWhile ( onNext , Functions . ON_ERROR_MISSING , Functions . EMPTY_ACTION ) ;


signature:
public class Flowable { /** * Subscribes to the { @ link Publisher } and receives notifications for each element and error events until the
 * onNext Predicate returns false .
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > The operator consumes the source { @ code Publisher } in an unbounded manner ( i . e . , no
 * backpressure is applied to it ) . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code forEachWhile } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param onNext
 * { @ link Predicate } to execute for each item .
 * @ param onError
 * { @ link Consumer } to execute when an error is emitted .
 * @ return
 * a { @ link Disposable } that allows canceling an asynchronous sequence
 * @ throws NullPointerException
 * if { @ code onNext } is null , or
 * if { @ code onError } is null
 * @ see < a href = " http : / / reactivex . io / documentation / operators / subscribe . html " > ReactiveX operators documentation : Subscribe < / a > */
@ CheckReturnValue @ BackpressureSupport ( BackpressureKind . NONE ) @ SchedulerSupport ( SchedulerSupport . NONE ) public final Disposable forEachWhile ( Predicate < ? super T > onNext , Consumer < ? super Throwable > onError ) { } }

implementation: return forEachWhile ( onNext , onError , Functions . EMPTY_ACTION ) ;


signature:
public class Flowable { /** * Subscribes to the { @ link Publisher } and receives notifications for each element and the terminal events until the
 * onNext Predicate returns false .
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > The operator consumes the source { @ code Publisher } in an unbounded manner ( i . e . , no
 * backpressure is applied to it ) . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code forEachWhile } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param onNext
 * { @ link Predicate } to execute for each item .
 * @ param onError
 * { @ link Consumer } to execute when an error is emitted .
 * @ param onComplete
 * { @ link Action } to execute when completion is signaled .
 * @ return
 * a { @ link Disposable } that allows canceling an asynchronous sequence
 * @ throws NullPointerException
 * if { @ code onNext } is null , or
 * if { @ code onError } is null , or
 * if { @ code onComplete } is null
 * @ see < a href = " http : / / reactivex . io / documentation / operators / subscribe . html " > ReactiveX operators documentation : Subscribe < / a > */
@ CheckReturnValue @ NonNull @ BackpressureSupport ( BackpressureKind . NONE ) @ SchedulerSupport ( SchedulerSupport . NONE ) public final Disposable forEachWhile ( final Predicate < ? super T > onNext , final Consumer < ? super Throwable > onError , final Action onComplete ) { } }

implementation: ObjectHelper . requireNonNull ( onNext , "onNext is null" ) ; ObjectHelper . requireNonNull ( onError , "onError is null" ) ; ObjectHelper . requireNonNull ( onComplete , "onComplete is null" ) ; ForEachWhileSubscriber < T > s = new ForEachWhileSubscriber < T > ( onNext , onError , onComplete ) ; subscribe ( s ) ; return s ;


signature:
public class Flowable { /** * Groups the items emitted by a { @ code Publisher } according to a specified criterion , and emits these
 * grouped items as { @ link GroupedFlowable } s . The emitted { @ code GroupedPublisher } allows only a single
 * { @ link Subscriber } during its lifetime and if this { @ code Subscriber } cancels before the
 * source terminates , the next emission by the source having the same key will trigger a new
 * { @ code GroupedPublisher } emission .
 * < img width = " 640 " height = " 360 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / groupBy . png " alt = " " >
 * < em > Note : < / em > A { @ link GroupedFlowable } will cache the items it is to emit until such time as it
 * is subscribed to . For this reason , in order to avoid memory leaks , you should not simply ignore those
 * { @ code GroupedPublisher } s that do not concern you . Instead , you can signal to them that they may
 * discard their buffers by applying an operator like { @ link # ignoreElements } to them .
 * Note that the { @ link GroupedFlowable } s should be subscribed to as soon as possible , otherwise ,
 * the unconsumed groups may starve other groups due to the internal backpressure
 * coordination of the { @ code groupBy } operator . Such hangs can be usually avoided by using
 * { @ link # flatMap ( Function , int ) } or { @ link # concatMapEager ( Function , int , int ) } and overriding the default maximum concurrency
 * value to be greater or equal to the expected number of groups , possibly using
 * { @ code Integer . MAX _ VALUE } if the number of expected groups is unknown .
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > Both the returned and its inner { @ code Publisher } s honor backpressure and the source { @ code Publisher }
 * is consumed in a bounded mode ( i . e . , requested a fixed amount upfront and replenished based on
 * downstream consumption ) . Note that both the returned and its inner { @ code Publisher } s use
 * unbounded internal buffers and if the source { @ code Publisher } doesn ' t honor backpressure , that < em > may < / em >
 * lead to { @ code OutOfMemoryError } . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code groupBy } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param keySelector
 * a function that extracts the key for each item
 * @ param < K >
 * the key type
 * @ return a { @ code Publisher } that emits { @ link GroupedFlowable } s , each of which corresponds to a
 * unique key value and each of which emits those items from the source Publisher that share that
 * key value
 * @ see < a href = " http : / / reactivex . io / documentation / operators / groupby . html " > ReactiveX operators documentation : GroupBy < / a > */
@ CheckReturnValue @ BackpressureSupport ( BackpressureKind . FULL ) @ SchedulerSupport ( SchedulerSupport . NONE ) public final < K > Flowable < GroupedFlowable < K , T > > groupBy ( Function < ? super T , ? extends K > keySelector ) { } }

implementation: return groupBy ( keySelector , Functions . < T > identity ( ) , false , bufferSize ( ) ) ;


signature:
public class Flowable { /** * Groups the items emitted by a { @ code Publisher } according to a specified criterion , and emits these
 * grouped items as { @ link GroupedFlowable } s . The emitted { @ code GroupedPublisher } allows only a single
 * { @ link Subscriber } during its lifetime and if this { @ code Subscriber } cancels before the
 * source terminates , the next emission by the source having the same key will trigger a new
 * { @ code GroupedPublisher } emission .
 * < img width = " 640 " height = " 360 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / groupBy . png " alt = " " >
 * < em > Note : < / em > A { @ link GroupedFlowable } will cache the items it is to emit until such time as it
 * is subscribed to . For this reason , in order to avoid memory leaks , you should not simply ignore those
 * { @ code GroupedPublisher } s that do not concern you . Instead , you can signal to them that they may
 * discard their buffers by applying an operator like { @ link # ignoreElements } to them .
 * Note that the { @ link GroupedFlowable } s should be subscribed to as soon as possible , otherwise ,
 * the unconsumed groups may starve other groups due to the internal backpressure
 * coordination of the { @ code groupBy } operator . Such hangs can be usually avoided by using
 * { @ link # flatMap ( Function , int ) } or { @ link # concatMapEager ( Function , int , int ) } and overriding the default maximum concurrency
 * value to be greater or equal to the expected number of groups , possibly using
 * { @ code Integer . MAX _ VALUE } if the number of expected groups is unknown .
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > Both the returned and its inner { @ code Publisher } s honor backpressure and the source { @ code Publisher }
 * is consumed in a bounded mode ( i . e . , requested a fixed amount upfront and replenished based on
 * downstream consumption ) . Note that both the returned and its inner { @ code Publisher } s use
 * unbounded internal buffers and if the source { @ code Publisher } doesn ' t honor backpressure , that < em > may < / em >
 * lead to { @ code OutOfMemoryError } . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code groupBy } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param keySelector
 * a function that extracts the key for each item
 * @ param valueSelector
 * a function that extracts the return element for each item
 * @ param < K >
 * the key type
 * @ param < V >
 * the element type
 * @ return a { @ code Publisher } that emits { @ link GroupedFlowable } s , each of which corresponds to a
 * unique key value and each of which emits those items from the source Publisher that share that
 * key value
 * @ see < a href = " http : / / reactivex . io / documentation / operators / groupby . html " > ReactiveX operators documentation : GroupBy < / a > */
@ CheckReturnValue @ BackpressureSupport ( BackpressureKind . FULL ) @ SchedulerSupport ( SchedulerSupport . NONE ) public final < K , V > Flowable < GroupedFlowable < K , V > > groupBy ( Function < ? super T , ? extends K > keySelector , Function < ? super T , ? extends V > valueSelector ) { } }

implementation: return groupBy ( keySelector , valueSelector , false , bufferSize ( ) ) ;


signature:
public class Flowable { /** * Groups the items emitted by a { @ code Publisher } according to a specified criterion , and emits these
 * grouped items as { @ link GroupedFlowable } s . The emitted { @ code GroupedPublisher } allows only a single
 * { @ link Subscriber } during its lifetime and if this { @ code Subscriber } cancels before the
 * source terminates , the next emission by the source having the same key will trigger a new
 * { @ code GroupedPublisher } emission .
 * < img width = " 640 " height = " 360 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / groupBy . png " alt = " " >
 * < em > Note : < / em > A { @ link GroupedFlowable } will cache the items it is to emit until such time as it
 * is subscribed to . For this reason , in order to avoid memory leaks , you should not simply ignore those
 * { @ code GroupedPublisher } s that do not concern you . Instead , you can signal to them that they may
 * discard their buffers by applying an operator like { @ link # ignoreElements } to them .
 * Note that the { @ link GroupedFlowable } s should be subscribed to as soon as possible , otherwise ,
 * the unconsumed groups may starve other groups due to the internal backpressure
 * coordination of the { @ code groupBy } operator . Such hangs can be usually avoided by using
 * { @ link # flatMap ( Function , int ) } or { @ link # concatMapEager ( Function , int , int ) } and overriding the default maximum concurrency
 * value to be greater or equal to the expected number of groups , possibly using
 * { @ code Integer . MAX _ VALUE } if the number of expected groups is unknown .
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > Both the returned and its inner { @ code Publisher } s honor backpressure and the source { @ code Publisher }
 * is consumed in a bounded mode ( i . e . , requested a fixed amount upfront and replenished based on
 * downstream consumption ) . Note that both the returned and its inner { @ code Publisher } s use
 * unbounded internal buffers and if the source { @ code Publisher } doesn ' t honor backpressure , that < em > may < / em >
 * lead to { @ code OutOfMemoryError } . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code groupBy } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param keySelector
 * a function that extracts the key for each item
 * @ param valueSelector
 * a function that extracts the return element for each item
 * @ param delayError
 * if true , the exception from the current Flowable is delayed in each group until that specific group emitted
 * the normal values ; if false , the exception bypasses values in the groups and is reported immediately .
 * @ param bufferSize
 * the hint for how many { @ link GroupedFlowable } s and element in each { @ link GroupedFlowable } should be buffered
 * @ param < K >
 * the key type
 * @ param < V >
 * the element type
 * @ return a { @ code Publisher } that emits { @ link GroupedFlowable } s , each of which corresponds to a
 * unique key value and each of which emits those items from the source Publisher that share that
 * key value
 * @ see < a href = " http : / / reactivex . io / documentation / operators / groupby . html " > ReactiveX operators documentation : GroupBy < / a > */
@ CheckReturnValue @ NonNull @ BackpressureSupport ( BackpressureKind . FULL ) @ SchedulerSupport ( SchedulerSupport . NONE ) public final < K , V > Flowable < GroupedFlowable < K , V > > groupBy ( Function < ? super T , ? extends K > keySelector , Function < ? super T , ? extends V > valueSelector , boolean delayError , int bufferSize ) { } }

implementation: ObjectHelper . requireNonNull ( keySelector , "keySelector is null" ) ; ObjectHelper . requireNonNull ( valueSelector , "valueSelector is null" ) ; ObjectHelper . verifyPositive ( bufferSize , "bufferSize" ) ; return RxJavaPlugins . onAssembly ( new FlowableGroupBy < T , K , V > ( this , keySelector , valueSelector , bufferSize , delayError , null ) ) ;


signature:
public class Flowable { /** * Hides the identity of this Flowable and its Subscription .
 * < p > Allows hiding extra features such as { @ link Processor } ' s
 * { @ link Subscriber } methods or preventing certain identity - based
 * optimizations ( fusion ) .
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > The operator is a pass - through for backpressure , the behavior is determined by the upstream ' s
 * backpressure behavior . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code hide } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ return the new Flowable instance
 * @ since 2.0 */
@ CheckReturnValue @ BackpressureSupport ( BackpressureKind . PASS_THROUGH ) @ SchedulerSupport ( SchedulerSupport . NONE ) public final Flowable < T > hide ( ) { } }

implementation: return RxJavaPlugins . onAssembly ( new FlowableHide < T > ( this ) ) ;


signature:
public class Flowable { /** * Ignores all items emitted by the source Publisher and only calls { @ code onComplete } or { @ code onError } .
 * < img width = " 640 " height = " 305 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / ignoreElements . png " alt = " " >
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > This operator ignores backpressure as it doesn ' t emit any elements and consumes the source { @ code Publisher }
 * in an unbounded manner ( i . e . , no backpressure is applied to it ) . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code ignoreElements } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ return a Completable that only calls { @ code onComplete } or { @ code onError } , based on which one is
 * called by the source Publisher
 * @ see < a href = " http : / / reactivex . io / documentation / operators / ignoreelements . html " > ReactiveX operators documentation : IgnoreElements < / a > */
@ CheckReturnValue @ BackpressureSupport ( BackpressureKind . UNBOUNDED_IN ) @ SchedulerSupport ( SchedulerSupport . NONE ) public final Completable ignoreElements ( ) { } }

implementation: return RxJavaPlugins . onAssembly ( new FlowableIgnoreElementsCompletable < T > ( this ) ) ;


signature:
public class Flowable { /** * Returns a Single that emits { @ code true } if the source Publisher is empty , otherwise { @ code false } .
 * In Rx . Net this is negated as the { @ code any } Subscriber but we renamed this in RxJava to better match Java
 * naming idioms .
 * < img width = " 640 " height = " 320 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / isEmpty . png " alt = " " >
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > The operator honors backpressure from downstream and consumes the source { @ code Publisher } in an
 * unbounded manner ( i . e . , without applying backpressure ) . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code isEmpty } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ return a Flowable that emits a Boolean
 * @ see < a href = " http : / / reactivex . io / documentation / operators / contains . html " > ReactiveX operators documentation : Contains < / a > */
@ CheckReturnValue @ BackpressureSupport ( BackpressureKind . UNBOUNDED_IN ) @ SchedulerSupport ( SchedulerSupport . NONE ) public final Single < Boolean > isEmpty ( ) { } }

implementation: return all ( Functions . alwaysFalse ( ) ) ;


signature:
public class Flowable { /** * Returns a Maybe that emits the last item emitted by this Flowable or completes if
 * this Flowable is empty .
 * < img width = " 640 " height = " 305 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / last . png " alt = " " >
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > The operator honors backpressure from downstream and consumes the source { @ code Publisher } in an
 * unbounded manner ( i . e . , without applying backpressure ) . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code lastElement } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ return a new Maybe instance
 * @ see < a href = " http : / / reactivex . io / documentation / operators / last . html " > ReactiveX operators documentation : Last < / a > */
@ CheckReturnValue @ BackpressureSupport ( BackpressureKind . UNBOUNDED_IN ) @ SchedulerSupport ( SchedulerSupport . NONE ) public final Maybe < T > lastElement ( ) { } }

implementation: return RxJavaPlugins . onAssembly ( new FlowableLastMaybe < T > ( this ) ) ;


signature:
public class Flowable { /** * Returns a Single that emits only the last item emitted by this Flowable or signals
 * a { @ link NoSuchElementException } if this Flowable is empty .
 * < img width = " 640 " height = " 236 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / lastOrError . png " alt = " " >
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > The operator honors backpressure from downstream and consumes the source { @ code Publisher } in an
 * unbounded manner ( i . e . , without applying backpressure ) . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code lastOrError } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ return the new Single instance
 * @ see < a href = " http : / / reactivex . io / documentation / operators / last . html " > ReactiveX operators documentation : Last < / a > */
@ CheckReturnValue @ BackpressureSupport ( BackpressureKind . UNBOUNDED_IN ) @ SchedulerSupport ( SchedulerSupport . NONE ) public final Single < T > lastOrError ( ) { } }

implementation: return RxJavaPlugins . onAssembly ( new FlowableLastSingle < T > ( this , null ) ) ;


signature:
public class Flowable { /** * Limits both the number of upstream items ( after which the sequence completes )
 * and the total downstream request amount requested from the upstream to
 * possibly prevent the creation of excess items by the upstream .
 * The operator requests at most the given { @ code count } of items from upstream even
 * if the downstream requests more than that . For example , given a { @ code limit ( 5 ) } ,
 * if the downstream requests 1 , a request of 1 is submitted to the upstream
 * and the operator remembers that only 4 items can be requested now on . A request
 * of 5 at this point will request 4 from the upstream and any subsequent requests will
 * be ignored .
 * Note that requests are negotiated on an operator boundary and { @ code limit } ' s amount
 * may not be preserved further upstream . For example ,
 * { @ code source . observeOn ( Schedulers . computation ( ) ) . limit ( 5 ) } will still request the
 * default ( 128 ) elements from the given { @ code source } .
 * The main use of this operator is with sources that are async boundaries that
 * don ' t interfere with request amounts , such as certain { @ code Flowable } - based
 * network endpoints that relay downstream request amounts unchanged and are , therefore ,
 * prone to trigger excessive item creation / transmission over the network .
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > The operator requests a total of the given { @ code count } items from the upstream . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code limit } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * < p > History : 2.1.6 - experimental
 * @ param count the maximum number of items and the total request amount , non - negative .
 * Zero will immediately cancel the upstream on subscription and complete
 * the downstream .
 * @ return the new Flowable instance
 * @ see # take ( long )
 * @ see # rebatchRequests ( int )
 * @ since 2.2 */
@ BackpressureSupport ( BackpressureKind . SPECIAL ) @ SchedulerSupport ( SchedulerSupport . NONE ) @ CheckReturnValue public final Flowable < T > limit ( long count ) { } }

implementation: if ( count < 0 ) { throw new IllegalArgumentException ( "count >= 0 required but it was " + count ) ; } return RxJavaPlugins . onAssembly ( new FlowableLimit < T > ( this , count ) ) ;