signature:
public class Observable { /** * Returns an Observable that delays the subscription to and emissions from the source ObservableSource via another
 * ObservableSource 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 ObservableSource will immediately propagate any { @ code onError } notification
 * from the source ObservableSource .
 * < dl >
 * < 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 subscriptionDelay
 * a function that returns an ObservableSource that triggers the subscription to the source ObservableSource
 * once it emits any item
 * @ param itemDelay
 * a function that returns an ObservableSource for each item emitted by the source ObservableSource , which is
 * then used to delay the emission of that item by the resulting ObservableSource until the ObservableSource
 * returned from { @ code itemDelay } emits an item
 * @ return an Observable that delays the subscription and emissions of the source ObservableSource via another
 * ObservableSource on a per - item basis
 * @ see < a href = " http : / / reactivex . io / documentation / operators / delay . html " > ReactiveX operators documentation : Delay < / a > */
@ CheckReturnValue @ SchedulerSupport ( SchedulerSupport . NONE ) public final < U , V > Observable < T > delay ( ObservableSource < U > subscriptionDelay , Function < ? super T , ? extends ObservableSource < V > > itemDelay ) { } }

implementation: return delaySubscription ( subscriptionDelay ) . delay ( itemDelay ) ;


signature:
public class Observable { /** * Returns an Observable that delays the subscription to this Observable
 * until the other Observable emits an element or completes normally .
 * < img width = " 640 " height = " 310 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / delaySubscription . o . png " alt = " " >
 * < dl >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > This method does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param < U > the value type of the other Observable , irrelevant
 * @ param other the other Observable that should trigger the subscription
 * to this Observable .
 * @ return an Observable that delays the subscription to this Observable
 * until the other Observable emits an element or completes normally .
 * @ since 2.0 */
@ CheckReturnValue @ SchedulerSupport ( SchedulerSupport . NONE ) public final < U > Observable < T > delaySubscription ( ObservableSource < U > other ) { } }

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


signature:
public class Observable { /** * Returns an Observable that delays the subscription to the source ObservableSource by a given amount of time ,
 * both waiting and subscribing on a given Scheduler .
 * < img width = " 640 " height = " 310 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / delaySubscription . s . png " alt = " " >
 * < dl >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > You specify which { @ link Scheduler } this operator will use . < / dd >
 * < / dl >
 * @ param delay
 * the time to delay the subscription
 * @ param unit
 * the time unit of { @ code delay }
 * @ param scheduler
 * the Scheduler on which the waiting and subscription will happen
 * @ return an Observable that delays the subscription to the source ObservableSource by a given
 * amount , waiting and subscribing on the given Scheduler
 * @ see < a href = " http : / / reactivex . io / documentation / operators / delay . html " > ReactiveX operators documentation : Delay < / a > */
@ CheckReturnValue @ SchedulerSupport ( SchedulerSupport . CUSTOM ) public final Observable < T > delaySubscription ( long delay , TimeUnit unit , Scheduler scheduler ) { } }

implementation: return delaySubscription ( timer ( delay , unit , scheduler ) ) ;


signature:
public class Observable { /** * Returns an Observable that reverses the effect of { @ link # materialize materialize } by transforming the
 * { @ link Notification } objects emitted by the source ObservableSource 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 Observable disposes of the flow and terminates with that type of terminal event :
 * < pre > < code >
 * Observable . just ( createOnNext ( 1 ) , createOnComplete ( ) , createOnNext ( 2 ) )
 * . doOnDispose ( ( ) - & gt ; System . out . println ( " Disposed ! " ) ) ;
 * . 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 >
 * Observable . 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 ( ObservableSource ) }
 * with a { @ link # never ( ) } source .
 * < dl >
 * < 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 an Observable that emits the items and notifications embedded in the { @ link Notification } objects
 * emitted by the source ObservableSource
 * @ 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 ) @ Deprecated @ SuppressWarnings ( { } }

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


signature:
public class Observable { /** * Returns an Observable 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 Observer } 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 Observable disposes of the flow and terminates with that type of terminal event :
 * < pre > < code >
 * Observable . just ( createOnNext ( 1 ) , createOnComplete ( ) , createOnNext ( 2 ) )
 * . doOnDispose ( ( ) - & gt ; System . out . println ( " Disposed ! " ) ) ;
 * . 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 >
 * Observable . 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 ( ObservableSource ) }
 * with a { @ link # never ( ) } source .
 * < dl >
 * < 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 Observer } event to the downstream .
 * @ return an Observable that emits the items and notifications embedded in the { @ link Notification } objects
 * selected from the items emitted by the source ObservableSource
 * @ see < a href = " http : / / reactivex . io / documentation / operators / materialize - dematerialize . html " > ReactiveX operators documentation : Dematerialize < / a >
 * @ since 2.2.4 - experimental */
@ Experimental @ CheckReturnValue @ SchedulerSupport ( SchedulerSupport . NONE ) public final < R > Observable < R > dematerialize ( Function < ? super T , Notification < R > > selector ) { } }

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


signature:
public class Observable { /** * Returns an Observable that emits all items emitted by the source ObservableSource 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 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 Observer 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 > Scheduler : < / b > < / dt >
 * < dd > { @ code distinct } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ return an Observable that emits only those items emitted by the source ObservableSource 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 ) */
@ CheckReturnValue @ SchedulerSupport ( SchedulerSupport . NONE ) public final Observable < T > distinct ( ) { } }

implementation: return distinct ( Functions . identity ( ) , Functions . createHashSet ( ) ) ;


signature:
public class Observable { /** * Returns an Observable that emits all items emitted by the source ObservableSource 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 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 Observer 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 > 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 an Observable that emits those items emitted by the source ObservableSource that have distinct keys
 * @ see < a href = " http : / / reactivex . io / documentation / operators / distinct . html " > ReactiveX operators documentation : Distinct < / a >
 * @ see # distinct ( Function , Callable ) */
@ CheckReturnValue @ SchedulerSupport ( SchedulerSupport . NONE ) public final < K > Observable < T > distinct ( Function < ? super T , K > keySelector ) { } }

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


signature:
public class Observable { /** * Returns an Observable that emits all items emitted by the source ObservableSource 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 meaningful comparison between the key objects as
 * the default Java implementation only considers reference equivalence .
 * < dl >
 * < 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 Observer to return a Collection subtype for holding the extracted
 * keys and whose add ( ) method ' s return indicates uniqueness .
 * @ return an Observable that emits those items emitted by the source ObservableSource that have distinct keys
 * @ see < a href = " http : / / reactivex . io / documentation / operators / distinct . html " > ReactiveX operators documentation : Distinct < / a > */
@ CheckReturnValue @ SchedulerSupport ( SchedulerSupport . NONE ) public final < K > Observable < 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 ObservableDistinct < T , K > ( this , keySelector , collectionSupplier ) ) ;


signature:
public class Observable { /** * Returns an Observable that emits all items emitted by the source ObservableSource 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
 * 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 > Scheduler : < / b > < / dt >
 * < dd > { @ code distinctUntilChanged } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ return an Observable that emits those items from the source ObservableSource 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 @ SchedulerSupport ( SchedulerSupport . NONE ) public final Observable < T > distinctUntilChanged ( ) { } }

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


signature:
public class Observable { /** * Returns an Observable that emits all items emitted by the source ObservableSource 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
 * 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 > 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 an Observable that emits those items from the source ObservableSource 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 @ SchedulerSupport ( SchedulerSupport . NONE ) public final < K > Observable < T > distinctUntilChanged ( Function < ? super T , K > keySelector ) { } }

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


signature:
public class Observable { /** * Returns an Observable that emits all items emitted by the source ObservableSource 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 > 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 an Observable that emits those items from the source ObservableSource 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 @ SchedulerSupport ( SchedulerSupport . NONE ) public final Observable < T > distinctUntilChanged ( BiPredicate < ? super T , ? super T > comparer ) { } }

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


signature:
public class Observable { /** * 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 .
 * < img width = " 640 " height = " 360 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / doAfterNext . o . png " alt = " " >
 * < dl >
 * < 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 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 Observable instance
 * @ since 2.1 */
@ CheckReturnValue @ SchedulerSupport ( SchedulerSupport . NONE ) public final Observable < T > doAfterNext ( Consumer < ? super T > onAfterNext ) { } }

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


signature:
public class Observable { /** * Registers an { @ link Action } to be called when this ObservableSource invokes either
 * { @ link Observer # onComplete onComplete } or { @ link Observer # onError onError } .
 * < img width = " 640 " height = " 310 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / doAfterTerminate . png " alt = " " >
 * < dl >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code doAfterTerminate } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param onFinally
 * an { @ link Action } to be invoked when the source ObservableSource finishes
 * @ return an Observable that emits the same items as the source ObservableSource , then invokes the
 * { @ link Action }
 * @ see < a href = " http : / / reactivex . io / documentation / operators / do . html " > ReactiveX operators documentation : Do < / a >
 * @ see # doOnTerminate ( Action ) */
@ CheckReturnValue @ SchedulerSupport ( SchedulerSupport . NONE ) public final Observable < T > doAfterTerminate ( Action onFinally ) { } }

implementation: ObjectHelper . requireNonNull ( onFinally , "onFinally is null" ) ; return doOnEach ( Functions . emptyConsumer ( ) , Functions . emptyConsumer ( ) , Functions . EMPTY_ACTION , onFinally ) ;


signature:
public class Observable { /** * Calls the specified action after this Observable signals onError or onCompleted or gets disposed by
 * the downstream .
 * < p > In case of a race between a terminal event and a dispose call , 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 .
 * < img width = " 640 " height = " 281 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / doFinally . o . png " alt = " " >
 * < dl >
 * < 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 boundary - limited synchronous or asynchronous queue - fusion . < / dd >
 * < / dl >
 * < p > History : 2.0.1 - experimental
 * @ param onFinally the action called when this Observable terminates or gets disposed
 * @ return the new Observable instance
 * @ since 2.1 */
@ CheckReturnValue @ SchedulerSupport ( SchedulerSupport . NONE ) public final Observable < T > doFinally ( Action onFinally ) { } }

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


signature:
public class Observable { /** * Calls the dispose { @ code Action } if the downstream disposes 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 dispose ( ) } call ,
 * sometimes as a { @ code CompositeException } if there were multiple exceptions along the way .
 * < img width = " 640 " height = " 310 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / doOnDispose . png " alt = " " >
 * < dl >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code doOnDispose } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param onDispose
 * the action that gets called when the source { @ code ObservableSource } ' s Disposable is disposed
 * @ return the source { @ code ObservableSource } modified so as to call this Action when appropriate
 * @ throws NullPointerException if onDispose is null
 * @ see < a href = " http : / / reactivex . io / documentation / operators / do . html " > ReactiveX operators documentation : Do < / a > */
@ CheckReturnValue @ SchedulerSupport ( SchedulerSupport . NONE ) public final Observable < T > doOnDispose ( Action onDispose ) { } }

implementation: return doOnLifecycle ( Functions . emptyConsumer ( ) , onDispose ) ;


signature:
public class Observable { /** * Modifies the source ObservableSource so that it invokes an action when it calls { @ code onComplete } .
 * < img width = " 640 " height = " 358 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / doOnComplete . o . png " alt = " " >
 * < dl >
 * < 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 ObservableSource calls { @ code onComplete }
 * @ return the source ObservableSource with the side - effecting behavior applied
 * @ see < a href = " http : / / reactivex . io / documentation / operators / do . html " > ReactiveX operators documentation : Do < / a > */
@ CheckReturnValue @ SchedulerSupport ( SchedulerSupport . NONE ) public final Observable < T > doOnComplete ( Action onComplete ) { } }

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


signature:
public class Observable { /** * 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 > Scheduler : < / b > < / dt >
 * < dd > { @ code doOnEach } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ return the source ObservableSource with the side - effecting behavior applied
 * @ see < a href = " http : / / reactivex . io / documentation / operators / do . html " > ReactiveX operators documentation : Do < / a > */
@ CheckReturnValue @ SchedulerSupport ( SchedulerSupport . NONE ) private Observable < 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 ObservableDoOnEach < T > ( this , onNext , onError , onComplete , onAfterTerminate ) ) ;


signature:
public class Observable { /** * Modifies the source ObservableSource 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 > 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 ObservableSource
 * @ return the source ObservableSource with the side - effecting behavior applied
 * @ see < a href = " http : / / reactivex . io / documentation / operators / do . html " > ReactiveX operators documentation : Do < / a > */
@ CheckReturnValue @ SchedulerSupport ( SchedulerSupport . NONE ) public final Observable < 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 Observable { /** * Modifies the source ObservableSource so that it notifies an Observer for each item and terminal event it emits .
 * In case the { @ code onError } of the supplied observer 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 observer 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 > Scheduler : < / b > < / dt >
 * < dd > { @ code doOnEach } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param observer
 * the observer to be notified about onNext , onError and onComplete events on its
 * respective methods before the actual downstream Observer gets notified .
 * @ return the source ObservableSource with the side - effecting behavior applied
 * @ see < a href = " http : / / reactivex . io / documentation / operators / do . html " > ReactiveX operators documentation : Do < / a > */
@ CheckReturnValue @ SchedulerSupport ( SchedulerSupport . NONE ) public final Observable < T > doOnEach ( final Observer < ? super T > observer ) { } }

implementation: ObjectHelper . requireNonNull ( observer , "observer is null" ) ; return doOnEach ( ObservableInternalHelper . observerOnNext ( observer ) , ObservableInternalHelper . observerOnError ( observer ) , ObservableInternalHelper . observerOnComplete ( observer ) , Functions . EMPTY_ACTION ) ;


signature:
public class Observable { /** * Modifies the source ObservableSource 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 = " 355 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / doOnError . o . png " alt = " " >
 * < dl >
 * < 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 ObservableSource calls { @ code onError }
 * @ return the source ObservableSource with the side - effecting behavior applied
 * @ see < a href = " http : / / reactivex . io / documentation / operators / do . html " > ReactiveX operators documentation : Do < / a > */
@ CheckReturnValue @ SchedulerSupport ( SchedulerSupport . NONE ) public final Observable < T > doOnError ( Consumer < ? super Throwable > onError ) { } }

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


signature:
public class Observable { /** * Calls the appropriate onXXX method ( shared between all Observer ) for the lifecycle events of
 * the sequence ( subscription , disposal ) .
 * < img width = " 640 " height = " 310 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / doOnLifecycle . o . png " alt = " " >
 * < dl >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code doOnLifecycle } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param onSubscribe
 * a Consumer called with the Disposable sent via Observer . onSubscribe ( )
 * @ param onDispose
 * called when the downstream disposes the Disposable via dispose ( )
 * @ return the source ObservableSource with the side - effecting behavior applied
 * @ see < a href = " http : / / reactivex . io / documentation / operators / do . html " > ReactiveX operators documentation : Do < / a > */
@ CheckReturnValue @ SchedulerSupport ( SchedulerSupport . NONE ) public final Observable < T > doOnLifecycle ( final Consumer < ? super Disposable > onSubscribe , final Action onDispose ) { } }

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


signature:
public class Observable { /** * Modifies the source ObservableSource so that it invokes an action when it calls { @ code onNext } .
 * < img width = " 640 " height = " 360 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / doOnNext . o . png " alt = " " >
 * < dl >
 * < 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 ObservableSource calls { @ code onNext }
 * @ return the source ObservableSource with the side - effecting behavior applied
 * @ see < a href = " http : / / reactivex . io / documentation / operators / do . html " > ReactiveX operators documentation : Do < / a > */
@ CheckReturnValue @ SchedulerSupport ( SchedulerSupport . NONE ) public final Observable < T > doOnNext ( Consumer < ? super T > onNext ) { } }

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


signature:
public class Observable { /** * Modifies the source { @ code ObservableSource } 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 ObservableSource } is reference counted , in which case the source { @ code ObservableSource } 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 > 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 an Observer subscribes to the current { @ code Observable }
 * @ return the source { @ code ObservableSource } 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 @ SchedulerSupport ( SchedulerSupport . NONE ) public final Observable < T > doOnSubscribe ( Consumer < ? super Disposable > onSubscribe ) { } }

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


signature:
public class Observable { /** * Modifies the source ObservableSource so that it invokes an action when it calls { @ code onComplete } or
 * { @ code onError } .
 * < img width = " 640 " height = " 327 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / doOnTerminate . o . png " alt = " " >
 * This differs from { @ code doAfterTerminate } in that this happens < em > before < / em > the { @ code onComplete } or
 * { @ code onError } notification .
 * < dl >
 * < 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 ObservableSource calls { @ code onComplete } or { @ code onError }
 * @ return the source ObservableSource 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 @ SchedulerSupport ( SchedulerSupport . NONE ) public final Observable < T > doOnTerminate ( final Action onTerminate ) { } }

implementation: ObjectHelper . requireNonNull ( onTerminate , "onTerminate is null" ) ; return doOnEach ( Functions . emptyConsumer ( ) , Functions . actionConsumer ( onTerminate ) , onTerminate , Functions . EMPTY_ACTION ) ;


signature:
public class Observable { /** * Returns a Maybe that emits the single item at a specified index in a sequence of emissions from
 * this Observable or completes if this Observable signals fewer elements than index .
 * < img width = " 640 " height = " 363 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / elementAt . o . png " alt = " " >
 * < dl >
 * < 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 ObservableSource
 * @ 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 @ 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 ObservableElementAtMaybe < T > ( this , index ) ) ;


signature:
public class Observable { /** * Returns a Single that emits the item found at a specified index in a sequence of emissions from
 * this Observable , or a default item if that index is out of range .
 * < img width = " 640 " height = " 353 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / elementAtDefault . o . png " alt = " " >
 * < dl >
 * < 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
 * @ param defaultItem
 * the default item
 * @ return a Single that emits the item at the specified position in the sequence emitted by the source
 * ObservableSource , 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 @ SchedulerSupport ( SchedulerSupport . NONE ) public final Single < T > elementAt ( long index , T defaultItem ) { } }

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


signature:
public class Observable { /** * Returns a Single that emits the item found at a specified index in a sequence of emissions from this Observable
 * or signals a { @ link NoSuchElementException } if this Observable signals fewer elements than index .
 * < img width = " 640 " height = " 362 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / elementAtOrError . o . png " alt = " " >
 * < dl >
 * < 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
 * ObservableSource , 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 @ 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 ObservableElementAtSingle < T > ( this , index , null ) ) ;


signature:
public class Observable { /** * Filters items emitted by an ObservableSource 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 > 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 ObservableSource , returning { @ code true }
 * if it passes the filter
 * @ return an Observable that emits only those items emitted by the source ObservableSource that the filter
 * evaluates as { @ code true }
 * @ see < a href = " http : / / reactivex . io / documentation / operators / filter . html " > ReactiveX operators documentation : Filter < / a > */
@ CheckReturnValue @ SchedulerSupport ( SchedulerSupport . NONE ) public final Observable < T > filter ( Predicate < ? super T > predicate ) { } }

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


signature:
public class Observable { /** * Returns a Single that emits only the very first item emitted by the source ObservableSource , or a default item
 * if the source ObservableSource completes without emitting any items .
 * < img width = " 640 " height = " 286 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / first . s . png " alt = " " >
 * < dl >
 * < 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 ObservableSource doesn ' t emit anything
 * @ return the new Single instance
 * @ see < a href = " http : / / reactivex . io / documentation / operators / first . html " > ReactiveX operators documentation : First < / a > */
@ CheckReturnValue @ SchedulerSupport ( SchedulerSupport . NONE ) public final Single < T > first ( T defaultItem ) { } }

implementation: return elementAt ( 0L , defaultItem ) ;


signature:
public class Observable { /** * Returns an Observable that emits items based on applying a function that you supply to each item emitted
 * by the source ObservableSource , where that function returns an ObservableSource , and then merging those resulting
 * ObservableSources and emitting the results of this merger .
 * < img width = " 640 " height = " 356 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / flatMapDelayError . o . png " alt = " " >
 * < dl >
 * < 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 ObservableSources and the output type
 * @ param mapper
 * a function that , when applied to an item emitted by the source ObservableSource , returns an
 * ObservableSource
 * @ param delayErrors
 * if true , exceptions from the current Observable and all inner ObservableSources are delayed until all of them terminate
 * if false , the first one signalling an exception will terminate the whole sequence immediately
 * @ return an Observable that emits the result of applying the transformation function to each item emitted
 * by the source ObservableSource and merging the results of the ObservableSources obtained from this
 * transformation
 * @ see < a href = " http : / / reactivex . io / documentation / operators / flatmap . html " > ReactiveX operators documentation : FlatMap < / a > */
@ CheckReturnValue @ SchedulerSupport ( SchedulerSupport . NONE ) public final < R > Observable < R > flatMap ( Function < ? super T , ? extends ObservableSource < ? extends R > > mapper , boolean delayErrors ) { } }

implementation: return flatMap ( mapper , delayErrors , Integer . MAX_VALUE ) ;


signature:
public class Observable { /** * Returns an Observable that emits items based on applying a function that you supply to each item emitted
 * by the source ObservableSource , where that function returns an ObservableSource , and then merging those resulting
 * ObservableSources and emitting the results of this merger , while limiting the maximum number of concurrent
 * subscriptions to these ObservableSources .
 * < img width = " 640 " height = " 441 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / flatMapMaxConcurrency . o . png " alt = " " >
 * < dl >
 * < 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 ObservableSources and the output type
 * @ param mapper
 * a function that , when applied to an item emitted by the source ObservableSource , returns an
 * ObservableSource
 * @ param maxConcurrency
 * the maximum number of ObservableSources that may be subscribed to concurrently
 * @ param delayErrors
 * if true , exceptions from the current Observable and all inner ObservableSources are delayed until all of them terminate
 * if false , the first one signalling an exception will terminate the whole sequence immediately
 * @ param bufferSize
 * the number of elements to prefetch from each inner ObservableSource
 * @ return an Observable that emits the result of applying the transformation function to each item emitted
 * by the source ObservableSource and merging the results of the ObservableSources obtained from this
 * transformation
 * @ see < a href = " http : / / reactivex . io / documentation / operators / flatmap . html " > ReactiveX operators documentation : FlatMap < / a >
 * @ since 2.0 */
@ CheckReturnValue @ SchedulerSupport ( SchedulerSupport . NONE ) public final < R > Observable < R > flatMap ( Function < ? super T , ? extends ObservableSource < ? 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 ObservableScalarXMap . scalarXMap ( v , mapper ) ; } return RxJavaPlugins . onAssembly ( new ObservableFlatMap < T , R > ( this , mapper , delayErrors , maxConcurrency , bufferSize ) ) ;


signature:
public class Observable { /** * Returns an Observable that applies a function to each item emitted or notification raised by the source
 * ObservableSource and then flattens the ObservableSources 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 > 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 an ObservableSource to merge for each item emitted by the source ObservableSource
 * @ param onErrorMapper
 * a function that returns an ObservableSource to merge for an onError notification from the source
 * ObservableSource
 * @ param onCompleteSupplier
 * a function that returns an ObservableSource to merge for an onComplete notification from the source
 * ObservableSource
 * @ return an Observable that emits the results of merging the ObservableSources returned from applying the
 * specified functions to the emissions and notifications of the source ObservableSource
 * @ see < a href = " http : / / reactivex . io / documentation / operators / flatmap . html " > ReactiveX operators documentation : FlatMap < / a > */
@ CheckReturnValue @ SchedulerSupport ( SchedulerSupport . NONE ) public final < R > Observable < R > flatMap ( Function < ? super T , ? extends ObservableSource < ? extends R > > onNextMapper , Function < ? super Throwable , ? extends ObservableSource < ? extends R > > onErrorMapper , Callable < ? extends ObservableSource < ? 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 ObservableMapNotification < T , R > ( this , onNextMapper , onErrorMapper , onCompleteSupplier ) ) ;


signature:
public class Observable { /** * Returns an Observable that emits the results of a specified function to the pair of values emitted by the
 * source ObservableSource and a specified collection ObservableSource .
 * < img width = " 640 " height = " 390 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / mergeMap . r . png " alt = " " >
 * < dl >
 * < 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 collection ObservableSource
 * @ param < R >
 * the type of items emitted by the resulting ObservableSource
 * @ param mapper
 * a function that returns an ObservableSource for each item emitted by the source ObservableSource
 * @ param resultSelector
 * a function that combines one item emitted by each of the source and collection ObservableSources and
 * returns an item to be emitted by the resulting ObservableSource
 * @ return an Observable that emits the results of applying a function to a pair of values emitted by the
 * source ObservableSource and the collection ObservableSource
 * @ see < a href = " http : / / reactivex . io / documentation / operators / flatmap . html " > ReactiveX operators documentation : FlatMap < / a > */
@ CheckReturnValue @ SchedulerSupport ( SchedulerSupport . NONE ) public final < U , R > Observable < R > flatMap ( Function < ? super T , ? extends ObservableSource < ? extends U > > mapper , BiFunction < ? super T , ? super U , ? extends R > resultSelector ) { } }

implementation: return flatMap ( mapper , resultSelector , false , bufferSize ( ) , bufferSize ( ) ) ;


signature:
public class Observable { /** * Maps each element of the upstream Observable into CompletableSources , subscribes to them and
 * waits until the upstream and all CompletableSources complete .
 * < img width = " 640 " height = " 424 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / flatMapCompletable . o . png " alt = " " >
 * < dl >
 * < 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 @ SchedulerSupport ( SchedulerSupport . NONE ) public final Completable flatMapCompletable ( Function < ? super T , ? extends CompletableSource > mapper ) { } }

implementation: return flatMapCompletable ( mapper , false ) ;


signature:
public class Observable { /** * Returns an Observable that emits the results of applying a function to the pair of values from the source
 * ObservableSource and an Iterable corresponding to that item that is generated by a selector .
 * < img width = " 640 " height = " 410 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / flatMapIterable . o . r . png " alt = " " >
 * < dl >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code flatMapIterable } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param < U >
 * the collection element type
 * @ param < V >
 * the type of item emitted by the resulting Iterable
 * @ param mapper
 * a function that returns an Iterable sequence of values for each item emitted by the source
 * ObservableSource
 * @ param resultSelector
 * a function that returns an item based on the item emitted by the source ObservableSource and the
 * Iterable returned for that item by the { @ code collectionSelector }
 * @ return an Observable that emits the items returned by { @ code resultSelector } for each item in the source
 * ObservableSource
 * @ see < a href = " http : / / reactivex . io / documentation / operators / flatmap . html " > ReactiveX operators documentation : FlatMap < / a > */
@ CheckReturnValue @ SchedulerSupport ( SchedulerSupport . NONE ) public final < U , V > Observable < V > flatMapIterable ( final Function < ? super T , ? extends Iterable < ? extends U > > mapper , BiFunction < ? super T , ? super U , ? extends V > resultSelector ) { } }

implementation: ObjectHelper . requireNonNull ( mapper , "mapper is null" ) ; ObjectHelper . requireNonNull ( resultSelector , "resultSelector is null" ) ; return flatMap ( ObservableInternalHelper . flatMapIntoIterable ( mapper ) , resultSelector , false , bufferSize ( ) , bufferSize ( ) ) ;


signature:
public class Observable { /** * Maps each element of the upstream Observable into MaybeSources , subscribes to all of them
 * and merges their onSuccess values , in no particular order , into a single Observable sequence .
 * < img width = " 640 " height = " 310 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / flatMapMaybe . png " alt = " " >
 * < dl >
 * < 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 Observable instance */
@ CheckReturnValue @ SchedulerSupport ( SchedulerSupport . NONE ) public final < R > Observable < R > flatMapMaybe ( Function < ? super T , ? extends MaybeSource < ? extends R > > mapper ) { } }

implementation: return flatMapMaybe ( mapper , false ) ;


signature:
public class Observable { /** * Maps each element of the upstream Observable into MaybeSources , subscribes to them
 * and merges their onSuccess values , in no particular order , into a single Observable sequence ,
 * optionally delaying all errors .
 * < img width = " 640 " height = " 310 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / flatMapMaybe . png " alt = " " >
 * < dl >
 * < 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 .
 * @ param delayErrors if true errors from the upstream and inner MaybeSources are delayed until each of them
 * terminates .
 * @ return the new Observable instance */
@ CheckReturnValue @ SchedulerSupport ( SchedulerSupport . NONE ) public final < R > Observable < R > flatMapMaybe ( Function < ? super T , ? extends MaybeSource < ? extends R > > mapper , boolean delayErrors ) { } }

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


signature:
public class Observable { /** * Maps each element of the upstream Observable into SingleSources , subscribes to all of them
 * and merges their onSuccess values , in no particular order , into a single Observable sequence .
 * < img width = " 640 " height = " 310 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / flatMapSingle . png " alt = " " >
 * < dl >
 * < 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 Observable instance */
@ CheckReturnValue @ SchedulerSupport ( SchedulerSupport . NONE ) public final < R > Observable < R > flatMapSingle ( Function < ? super T , ? extends SingleSource < ? extends R > > mapper ) { } }

implementation: return flatMapSingle ( mapper , false ) ;


signature:
public class Observable { /** * Maps each element of the upstream Observable into SingleSources , subscribes to them
 * and merges their onSuccess values , in no particular order , into a single Observable sequence ,
 * optionally delaying all errors .
 * < img width = " 640 " height = " 310 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / flatMapSingle . png " alt = " " >
 * < dl >
 * < 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 .
 * @ return the new Observable instance */
@ CheckReturnValue @ SchedulerSupport ( SchedulerSupport . NONE ) public final < R > Observable < R > flatMapSingle ( Function < ? super T , ? extends SingleSource < ? extends R > > mapper , boolean delayErrors ) { } }

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


signature:
public class Observable { /** * Subscribes to the { @ link ObservableSource } and receives notifications for each element and the terminal events until the
 * onNext Predicate returns false .
 * < dl >
 * < 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 signalled .
 * @ return
 * a Disposable that allows disposing of 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 @ SchedulerSupport ( SchedulerSupport . NONE ) public final Disposable forEachWhile ( final Predicate < ? super T > onNext , 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" ) ; ForEachWhileObserver < T > o = new ForEachWhileObserver < T > ( onNext , onError , onComplete ) ; subscribe ( o ) ; return o ;


signature:
public class Observable { /** * Groups the items emitted by an { @ code ObservableSource } according to a specified criterion , and emits these
 * grouped items as { @ link GroupedObservable } s . The emitted { @ code GroupedObservableSource } allows only a single
 * { @ link Observer } during its lifetime and if this { @ code Observer } calls dispose ( ) before the
 * source terminates , the next emission by the source having the same key will trigger a new
 * { @ code GroupedObservableSource } 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 GroupedObservable } 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 GroupedObservableSource } 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 .
 * < dl >
 * < 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 an { @ code ObservableSource } that emits { @ link GroupedObservable } s , each of which corresponds to a
 * unique key value and each of which emits those items from the source ObservableSource that share that
 * key value
 * @ see < a href = " http : / / reactivex . io / documentation / operators / groupby . html " > ReactiveX operators documentation : GroupBy < / a > */
@ SuppressWarnings ( { } }

implementation: "unchecked" , "rawtypes" } ) @ CheckReturnValue @ SchedulerSupport ( SchedulerSupport . NONE ) public final < K > Observable < GroupedObservable < K , T > > groupBy ( Function < ? super T , ? extends K > keySelector ) { return groupBy ( keySelector , ( Function ) Functions . identity ( ) , false , bufferSize ( ) ) ;


signature:
public class Observable { /** * Groups the items emitted by an { @ code ObservableSource } according to a specified criterion , and emits these
 * grouped items as { @ link GroupedObservable } s . The emitted { @ code GroupedObservableSource } allows only a single
 * { @ link Observer } during its lifetime and if this { @ code Observer } calls dispose ( ) before the
 * source terminates , the next emission by the source having the same key will trigger a new
 * { @ code GroupedObservableSource } 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 GroupedObservable } 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 GroupedObservableSource } 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 .
 * < dl >
 * < 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 an { @ code ObservableSource } that emits { @ link GroupedObservable } s , each of which corresponds to a
 * unique key value and each of which emits those items from the source ObservableSource that share that
 * key value
 * @ see < a href = " http : / / reactivex . io / documentation / operators / groupby . html " > ReactiveX operators documentation : GroupBy < / a > */
@ CheckReturnValue @ SchedulerSupport ( SchedulerSupport . NONE ) public final < K , V > Observable < GroupedObservable < 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 Observable { /** * Groups the items emitted by an { @ code ObservableSource } according to a specified criterion , and emits these
 * grouped items as { @ link GroupedObservable } s . The emitted { @ code GroupedObservableSource } allows only a single
 * { @ link Observer } during its lifetime and if this { @ code Observer } calls dispose ( ) before the
 * source terminates , the next emission by the source having the same key will trigger a new
 * { @ code GroupedObservableSource } 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 GroupedObservable } 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 GroupedObservableSource } 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 .
 * < dl >
 * < 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 Observable 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 GroupedObservable } s and element in each { @ link GroupedObservable } should be buffered
 * @ param < K >
 * the key type
 * @ param < V >
 * the element type
 * @ return an { @ code ObservableSource } that emits { @ link GroupedObservable } s , each of which corresponds to a
 * unique key value and each of which emits those items from the source ObservableSource that share that
 * key value
 * @ see < a href = " http : / / reactivex . io / documentation / operators / groupby . html " > ReactiveX operators documentation : GroupBy < / a > */
@ CheckReturnValue @ SchedulerSupport ( SchedulerSupport . NONE ) public final < K , V > Observable < GroupedObservable < 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 ObservableGroupBy < T , K , V > ( this , keySelector , valueSelector , bufferSize , delayError ) ) ;


signature:
public class Observable { /** * Hides the identity of this Observable and its Disposable .
 * < p > Allows hiding extra features such as { @ link io . reactivex . subjects . Subject } ' s
 * { @ link Observer } methods or preventing certain identity - based
 * optimizations ( fusion ) .
 * < img width = " 640 " height = " 283 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / hide . o . png " alt = " " >
 * < dl >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code hide } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ return the new Observable instance
 * @ since 2.0 */
@ CheckReturnValue @ SchedulerSupport ( SchedulerSupport . NONE ) public final Observable < T > hide ( ) { } }

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


signature:
public class Observable { /** * Ignores all items emitted by the source ObservableSource 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 . 2 . png " alt = " " >
 * < dl >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code ignoreElements } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ return the new Completable instance
 * @ see < a href = " http : / / reactivex . io / documentation / operators / ignoreelements . html " > ReactiveX operators documentation : IgnoreElements < / a > */
@ CheckReturnValue @ SchedulerSupport ( SchedulerSupport . NONE ) public final Completable ignoreElements ( ) { } }

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


signature:
public class Observable { /** * Returns a Single that emits { @ code true } if the source ObservableSource is empty , otherwise { @ code false } .
 * In Rx . Net this is negated as the { @ code any } Observer 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 . 2 . png " alt = " " >
 * < dl >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code isEmpty } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ return a Single that emits a Boolean
 * @ see < a href = " http : / / reactivex . io / documentation / operators / contains . html " > ReactiveX operators documentation : Contains < / a > */
@ CheckReturnValue @ SchedulerSupport ( SchedulerSupport . NONE ) public final Single < Boolean > isEmpty ( ) { } }

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


signature:
public class Observable { /** * Correlates the items emitted by two ObservableSources based on overlapping durations .
 * There are no guarantees in what order the items get combined when multiple
 * items from one or both source ObservableSources overlap .
 * < img width = " 640 " height = " 380 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / join _ . png " alt = " " >
 * < dl >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code join } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param < TRight > the value type of the right ObservableSource source
 * @ param < TLeftEnd > the element type of the left duration ObservableSources
 * @ param < TRightEnd > the element type of the right duration ObservableSources
 * @ param < R > the result type
 * @ param other
 * the second ObservableSource to join items from
 * @ param leftEnd
 * a function to select a duration for each item emitted by the source ObservableSource , used to
 * determine overlap
 * @ param rightEnd
 * a function to select a duration for each item emitted by the { @ code right } ObservableSource , used to
 * determine overlap
 * @ param resultSelector
 * a function that computes an item to be emitted by the resulting ObservableSource for any two
 * overlapping items emitted by the two ObservableSources
 * @ return an Observable that emits items correlating to items emitted by the source ObservableSources that have
 * overlapping durations
 * @ see < a href = " http : / / reactivex . io / documentation / operators / join . html " > ReactiveX operators documentation : Join < / a > */
@ CheckReturnValue @ SchedulerSupport ( SchedulerSupport . NONE ) public final < TRight , TLeftEnd , TRightEnd , R > Observable < R > join ( ObservableSource < ? extends TRight > other , Function < ? super T , ? extends ObservableSource < TLeftEnd > > leftEnd , Function < ? super TRight , ? extends ObservableSource < TRightEnd > > rightEnd , BiFunction < ? super T , ? super TRight , ? extends R > resultSelector ) { } }

implementation: ObjectHelper . requireNonNull ( other , "other is null" ) ; ObjectHelper . requireNonNull ( leftEnd , "leftEnd is null" ) ; ObjectHelper . requireNonNull ( rightEnd , "rightEnd is null" ) ; ObjectHelper . requireNonNull ( resultSelector , "resultSelector is null" ) ; return RxJavaPlugins . onAssembly ( new ObservableJoin < T , TRight , TLeftEnd , TRightEnd , R > ( this , other , leftEnd , rightEnd , resultSelector ) ) ;


signature:
public class Observable { /** * Returns a Maybe that emits the last item emitted by this Observable or
 * completes if this Observable is empty .
 * < img width = " 640 " height = " 305 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / lastElement . png " alt = " " >
 * < dl >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code lastElement } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ return a Maybe that emits the last item from the source ObservableSource or notifies observers of an
 * error
 * @ see < a href = " http : / / reactivex . io / documentation / operators / last . html " > ReactiveX operators documentation : Last < / a > */
@ CheckReturnValue @ SchedulerSupport ( SchedulerSupport . NONE ) public final Maybe < T > lastElement ( ) { } }

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


signature:
public class Observable { /** * Returns a Single that emits only the last item emitted by this Observable , or a default item
 * if this Observable completes without emitting any items .
 * < img width = " 640 " height = " 305 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / last . 2 . png " alt = " " >
 * < dl >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code last } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param defaultItem
 * the default item to emit if the source ObservableSource is empty
 * @ return a Single that emits only the last item emitted by the source ObservableSource , or a default item
 * if the source ObservableSource is empty
 * @ see < a href = " http : / / reactivex . io / documentation / operators / last . html " > ReactiveX operators documentation : Last < / a > */
@ CheckReturnValue @ SchedulerSupport ( SchedulerSupport . NONE ) public final Single < T > last ( T defaultItem ) { } }

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


signature:
public class Observable { /** * Returns a Single that emits only the last item emitted by this Observable or
 * signals a { @ link NoSuchElementException } if this Observable is empty .
 * < img width = " 640 " height = " 236 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / lastOrError . png " alt = " " >
 * < dl >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code lastOrError } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ return a Single that emits only the last item emitted by the source ObservableSource .
 * If the source ObservableSource completes without emitting any items a { @ link NoSuchElementException } will be thrown .
 * @ see < a href = " http : / / reactivex . io / documentation / operators / last . html " > ReactiveX operators documentation : Last < / a > */
@ CheckReturnValue @ SchedulerSupport ( SchedulerSupport . NONE ) public final Single < T > lastOrError ( ) { } }

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


signature:
public class Observable { /** * Returns an Observable that applies a specified function to each item emitted by the source ObservableSource and
 * emits the results of these function applications .
 * < img width = " 640 " height = " 305 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / map . png " alt = " " >
 * < dl >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code map } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param < R > the output type
 * @ param mapper
 * a function to apply to each item emitted by the ObservableSource
 * @ return an Observable that emits the items from the source ObservableSource , transformed by the specified
 * function
 * @ see < a href = " http : / / reactivex . io / documentation / operators / map . html " > ReactiveX operators documentation : Map < / a > */
@ CheckReturnValue @ SchedulerSupport ( SchedulerSupport . NONE ) public final < R > Observable < R > map ( Function < ? super T , ? extends R > mapper ) { } }

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


signature:
public class Observable { /** * Returns an Observable that represents all of the emissions < em > and < / em > notifications from the source
 * ObservableSource into emissions marked with their original types within { @ link Notification } objects .
 * < img width = " 640 " height = " 315 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / materialize . png " alt = " " >
 * < dl >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code materialize } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ return an Observable that emits items that are the result of materializing the items and notifications
 * of the source ObservableSource
 * @ see < a href = " http : / / reactivex . io / documentation / operators / materialize - dematerialize . html " > ReactiveX operators documentation : Materialize < / a >
 * @ see # dematerialize ( Function ) */
@ CheckReturnValue @ SchedulerSupport ( SchedulerSupport . NONE ) public final Observable < Notification < T > > materialize ( ) { } }

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


signature:
public class Observable { /** * Flattens this and another ObservableSource into a single ObservableSource , without any transformation .
 * < img width = " 640 " height = " 380 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / merge . png " alt = " " >
 * You can combine items emitted by multiple ObservableSources so that they appear as a single ObservableSource , by
 * using the { @ code mergeWith } method .
 * < dl >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code mergeWith } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param other
 * an ObservableSource to be merged
 * @ return an Observable that emits all of the items emitted by the source ObservableSources
 * @ see < a href = " http : / / reactivex . io / documentation / operators / merge . html " > ReactiveX operators documentation : Merge < / a > */
@ CheckReturnValue @ SchedulerSupport ( SchedulerSupport . NONE ) public final Observable < T > mergeWith ( ObservableSource < ? extends T > other ) { } }

implementation: ObjectHelper . requireNonNull ( other , "other is null" ) ; return merge ( this , other ) ;


signature:
public class Observable { /** * Merges the sequence of items of this Observable with the success value of the other SingleSource .
 * < img width = " 640 " height = " 380 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / merge . png " alt = " " >
 * The success value of the other { @ code SingleSource } can get interleaved at any point of this
 * { @ code Observable } sequence .
 * < dl >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code mergeWith } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * < p > History : 2.1.10 - experimental
 * @ param other the { @ code SingleSource } whose success value to merge with
 * @ return the new Observable instance
 * @ since 2.2 */
@ CheckReturnValue @ SchedulerSupport ( SchedulerSupport . NONE ) public final Observable < T > mergeWith ( @ NonNull SingleSource < ? extends T > other ) { } }

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


signature:
public class Observable { /** * Merges the sequence of items of this Observable with the success value of the other MaybeSource
 * or waits both to complete normally if the MaybeSource is empty .
 * < img width = " 640 " height = " 380 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / merge . png " alt = " " >
 * The success value of the other { @ code MaybeSource } can get interleaved at any point of this
 * { @ code Observable } sequence .
 * < dl >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code mergeWith } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * < p > History : 2.1.10 - experimental
 * @ param other the { @ code MaybeSource } which provides a success value to merge with or completes
 * @ return the new Observable instance
 * @ since 2.2 */
@ CheckReturnValue @ SchedulerSupport ( SchedulerSupport . NONE ) public final Observable < T > mergeWith ( @ NonNull MaybeSource < ? extends T > other ) { } }

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


signature:
public class Observable { /** * Relays the items of this Observable and completes only when the other CompletableSource completes
 * as well .
 * < img width = " 640 " height = " 380 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / merge . png " alt = " " >
 * < dl >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code mergeWith } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * < p > History : 2.1.10 - experimental
 * @ param other the { @ code CompletableSource } to await for completion
 * @ return the new Observable instance
 * @ since 2.2 */
@ CheckReturnValue @ SchedulerSupport ( SchedulerSupport . NONE ) public final Observable < T > mergeWith ( @ NonNull CompletableSource other ) { } }

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


signature:
public class Observable { /** * Modifies an ObservableSource to perform its emissions and notifications on a specified { @ link Scheduler } ,
 * asynchronously with an unbounded buffer with { @ link Flowable # bufferSize ( ) } " island size " .
 * < p > Note that onError notifications will cut ahead of onNext notifications on the emission thread if Scheduler is truly
 * asynchronous . If strict event ordering is required , consider using the { @ link # observeOn ( Scheduler , boolean ) } overload .
 * < img width = " 640 " height = " 308 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / observeOn . png " alt = " " >
 * < dl >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > You specify which { @ link Scheduler } this operator will use . < / dd >
 * < / dl >
 * < p > " Island size " indicates how large chunks the unbounded buffer allocates to store the excess elements waiting to be consumed
 * on the other side of the asynchronous boundary .
 * @ param scheduler
 * the { @ link Scheduler } to notify { @ link Observer } s on
 * @ return the source ObservableSource modified so that its { @ link Observer } s are notified on the specified
 * { @ link Scheduler }
 * @ see < a href = " http : / / reactivex . io / documentation / operators / observeon . html " > ReactiveX operators documentation : ObserveOn < / a >
 * @ see < a href = " http : / / www . grahamlea . com / 2014/07 / rxjava - threading - examples / " > RxJava Threading Examples < / a >
 * @ see # subscribeOn
 * @ see # observeOn ( Scheduler , boolean )
 * @ see # observeOn ( Scheduler , boolean , int ) */
@ CheckReturnValue @ SchedulerSupport ( SchedulerSupport . CUSTOM ) public final Observable < T > observeOn ( Scheduler scheduler ) { } }

implementation: return observeOn ( scheduler , false , bufferSize ( ) ) ;


signature:
public class Observable { /** * Modifies an ObservableSource to perform its emissions and notifications on a specified { @ link Scheduler } ,
 * asynchronously with an unbounded buffer of configurable " island size " and optionally delays onError notifications .
 * < img width = " 640 " height = " 308 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / observeOn . png " alt = " " >
 * < dl >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > You specify which { @ link Scheduler } this operator will use . < / dd >
 * < / dl >
 * < p > " Island size " indicates how large chunks the unbounded buffer allocates to store the excess elements waiting to be consumed
 * on the other side of the asynchronous boundary . Values below 16 are not recommended in performance sensitive scenarios .
 * @ param scheduler
 * the { @ link Scheduler } to notify { @ link Observer } s on
 * @ param delayError
 * indicates if the onError notification may not cut ahead of onNext notification on the other side of the
 * scheduling boundary . If true a sequence ending in onError will be replayed in the same order as was received
 * from upstream
 * @ param bufferSize the size of the buffer .
 * @ return the source ObservableSource modified so that its { @ link Observer } s are notified on the specified
 * { @ link Scheduler }
 * @ see < a href = " http : / / reactivex . io / documentation / operators / observeon . html " > ReactiveX operators documentation : ObserveOn < / a >
 * @ see < a href = " http : / / www . grahamlea . com / 2014/07 / rxjava - threading - examples / " > RxJava Threading Examples < / a >
 * @ see # subscribeOn
 * @ see # observeOn ( Scheduler )
 * @ see # observeOn ( Scheduler , boolean ) */
@ CheckReturnValue @ SchedulerSupport ( SchedulerSupport . CUSTOM ) public final Observable < T > observeOn ( Scheduler scheduler , boolean delayError , int bufferSize ) { } }

implementation: ObjectHelper . requireNonNull ( scheduler , "scheduler is null" ) ; ObjectHelper . verifyPositive ( bufferSize , "bufferSize" ) ; return RxJavaPlugins . onAssembly ( new ObservableObserveOn < T > ( this , scheduler , delayError , bufferSize ) ) ;


signature:
public class Observable { /** * Instructs an ObservableSource to pass control to another ObservableSource rather than invoking
 * { @ link Observer # onError onError } if it encounters an error .
 * < img width = " 640 " height = " 310 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / onErrorResumeNext . png " alt = " " >
 * By default , when an ObservableSource encounters an error that prevents it from emitting the expected item to
 * its { @ link Observer } , the ObservableSource invokes its Observer ' s { @ code onError } method , and then quits
 * without invoking any more of its Observer ' s methods . The { @ code onErrorResumeNext } method changes this
 * behavior . If you pass a function that returns an ObservableSource ( { @ code resumeFunction } ) to
 * { @ code onErrorResumeNext } , if the original ObservableSource encounters an error , instead of invoking its
 * Observer ' s { @ code onError } method , it will instead relinquish control to the ObservableSource returned from
 * { @ code resumeFunction } , which will invoke the Observer ' s { @ link Observer # onNext onNext } method if it is
 * able to do so . In such a case , because no ObservableSource necessarily invokes { @ code onError } , the Observer
 * may never know that an error happened .
 * You can use this to prevent errors from propagating or to supply fallback data should errors be
 * encountered .
 * < dl >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code onErrorResumeNext } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param resumeFunction
 * a function that returns an ObservableSource that will take over if the source ObservableSource encounters
 * an error
 * @ return the original ObservableSource , with appropriately modified behavior
 * @ see < a href = " http : / / reactivex . io / documentation / operators / catch . html " > ReactiveX operators documentation : Catch < / a > */
@ CheckReturnValue @ SchedulerSupport ( SchedulerSupport . NONE ) public final Observable < T > onErrorResumeNext ( Function < ? super Throwable , ? extends ObservableSource < ? extends T > > resumeFunction ) { } }

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


signature:
public class Observable { /** * Instructs an ObservableSource to pass control to another ObservableSource rather than invoking
 * { @ link Observer # onError onError } if it encounters an error .
 * < img width = " 640 " height = " 310 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / onErrorResumeNext . png " alt = " " >
 * By default , when an ObservableSource encounters an error that prevents it from emitting the expected item to
 * its { @ link Observer } , the ObservableSource invokes its Observer ' s { @ code onError } method , and then quits
 * without invoking any more of its Observer ' s methods . The { @ code onErrorResumeNext } method changes this
 * behavior . If you pass another ObservableSource ( { @ code resumeSequence } ) to an ObservableSource ' s
 * { @ code onErrorResumeNext } method , if the original ObservableSource encounters an error , instead of invoking its
 * Observer ' s { @ code onError } method , it will instead relinquish control to { @ code resumeSequence } which
 * will invoke the Observer ' s { @ link Observer # onNext onNext } method if it is able to do so . In such a case ,
 * because no ObservableSource necessarily invokes { @ code onError } , the Observer may never know that an error
 * happened .
 * You can use this to prevent errors from propagating or to supply fallback data should errors be
 * encountered .
 * < dl >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code onErrorResumeNext } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param next
 * the next ObservableSource source that will take over if the source ObservableSource encounters
 * an error
 * @ return the original ObservableSource , with appropriately modified behavior
 * @ see < a href = " http : / / reactivex . io / documentation / operators / catch . html " > ReactiveX operators documentation : Catch < / a > */
@ CheckReturnValue @ SchedulerSupport ( SchedulerSupport . NONE ) public final Observable < T > onErrorResumeNext ( final ObservableSource < ? extends T > next ) { } }

implementation: ObjectHelper . requireNonNull ( next , "next is null" ) ; return onErrorResumeNext ( Functions . justFunction ( next ) ) ;