signature:
public class QueueDrainObserver { /** * Makes sure the fast - path emits in order .
 * @ param value the value to emit or queue up
 * @ param delayError if true , errors are delayed until the source has terminated
 * @ param disposable the resource to dispose if the drain terminates */
protected final void fastPathOrderedEmit ( U value , boolean delayError , Disposable disposable ) { } }

implementation: final Observer < ? super V > observer = downstream ; final SimplePlainQueue < U > q = queue ; if ( wip . get ( ) == 0 && wip . compareAndSet ( 0 , 1 ) ) { if ( q . isEmpty ( ) ) { accept ( observer , value ) ; if ( leave ( - 1 ) == 0 ) { return ; } } else { q . offer ( value ) ; } } else { q . offer ( value ) ; if ( ! enter ( ) ) { return ; } } QueueDrainHelper . drainLoop ( q , observer , delayError , disposable , this ) ;


signature:
public class Observable { /** * Mirrors the one ObservableSource in an Iterable of several ObservableSources that first either emits an item or sends
 * a termination notification .
 * < img width = " 640 " height = " 385 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / amb . png " alt = " " >
 * < dl >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code amb } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param < T > the common element type
 * @ param sources
 * an Iterable of ObservableSource sources competing to react first . A subscription to each source will
 * occur in the same order as in the Iterable .
 * @ return an Observable that emits the same sequence as whichever of the source ObservableSources first
 * emitted an item or sent a termination notification
 * @ see < a href = " http : / / reactivex . io / documentation / operators / amb . html " > ReactiveX operators documentation : Amb < / a > */
@ CheckReturnValue @ NonNull @ SchedulerSupport ( SchedulerSupport . NONE ) public static < T > Observable < T > amb ( Iterable < ? extends ObservableSource < ? extends T > > sources ) { } }

implementation: ObjectHelper . requireNonNull ( sources , "sources is null" ) ; return RxJavaPlugins . onAssembly ( new ObservableAmb < T > ( null , sources ) ) ;


signature:
public class Observable { /** * Mirrors the one ObservableSource in an array of several ObservableSources that first either emits an item or sends
 * a termination notification .
 * < img width = " 640 " height = " 385 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / amb . png " alt = " " >
 * < dl >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code ambArray } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param < T > the common element type
 * @ param sources
 * an array of ObservableSource sources competing to react first . A subscription to each source will
 * occur in the same order as in the array .
 * @ return an Observable that emits the same sequence as whichever of the source ObservableSources first
 * emitted an item or sent a termination notification
 * @ see < a href = " http : / / reactivex . io / documentation / operators / amb . html " > ReactiveX operators documentation : Amb < / a > */
@ SuppressWarnings ( "unchecked" ) @ CheckReturnValue @ NonNull @ SchedulerSupport ( SchedulerSupport . NONE ) public static < T > Observable < T > ambArray ( ObservableSource < ? extends T > ... sources ) { } }

implementation: ObjectHelper . requireNonNull ( sources , "sources is null" ) ; int len = sources . length ; if ( len == 0 ) { return empty ( ) ; } if ( len == 1 ) { return ( Observable < T > ) wrap ( sources [ 0 ] ) ; } return RxJavaPlugins . onAssembly ( new ObservableAmb < T > ( sources , null ) ) ;


signature:
public class Observable { /** * Concatenates elements of each ObservableSource provided via an Iterable sequence into a single sequence
 * of elements without interleaving them .
 * < img width = " 640 " height = " 380 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / concat . png " alt = " " >
 * < dl >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code concat } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param < T > the common value type of the sources
 * @ param sources the Iterable sequence of ObservableSources
 * @ return the new Observable instance */
@ SuppressWarnings ( { } }

implementation: "unchecked" , "rawtypes" } ) @ CheckReturnValue @ NonNull @ SchedulerSupport ( SchedulerSupport . NONE ) public static < T > Observable < T > concat ( Iterable < ? extends ObservableSource < ? extends T > > sources ) { ObjectHelper . requireNonNull ( sources , "sources is null" ) ; return fromIterable ( sources ) . concatMapDelayError ( ( Function ) Functions . identity ( ) , bufferSize ( ) , false ) ;


signature:
public class Observable { /** * Returns an Observable that emits the items emitted by each of the ObservableSources emitted by the source
 * ObservableSource , one after the other , without interleaving them .
 * < img width = " 640 " height = " 380 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / concat . png " alt = " " >
 * < dl >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code concat } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param < T > the common element base type
 * @ param sources
 * an ObservableSource that emits ObservableSources
 * @ param prefetch
 * the number of ObservableSources to prefetch from the sources sequence .
 * @ return an Observable that emits items all of the items emitted by the ObservableSources emitted by
 * { @ code ObservableSources } , one after the other , without interleaving them
 * @ see < a href = " http : / / reactivex . io / documentation / operators / concat . html " > ReactiveX operators documentation : Concat < / a > */
@ SuppressWarnings ( { } }

implementation: "unchecked" , "rawtypes" } ) @ CheckReturnValue @ NonNull @ SchedulerSupport ( SchedulerSupport . NONE ) public static < T > Observable < T > concat ( ObservableSource < ? extends ObservableSource < ? extends T > > sources , int prefetch ) { ObjectHelper . requireNonNull ( sources , "sources is null" ) ; ObjectHelper . verifyPositive ( prefetch , "prefetch" ) ; return RxJavaPlugins . onAssembly ( new ObservableConcatMap ( sources , Functions . identity ( ) , prefetch , ErrorMode . IMMEDIATE ) ) ;


signature:
public class Observable { /** * Concatenates a variable number of ObservableSource sources .
 * Note : named this way because of overload conflict with concat ( ObservableSource & lt ; ObservableSource & gt ; )
 * < img width = " 640 " height = " 290 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / concatArray . png " alt = " " >
 * < dl >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code concatArray } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param sources the array of sources
 * @ param < T > the common base value type
 * @ return the new Observable instance
 * @ throws NullPointerException if sources is null */
@ SuppressWarnings ( { } }

implementation: "unchecked" , "rawtypes" } ) @ CheckReturnValue @ SchedulerSupport ( SchedulerSupport . NONE ) public static < T > Observable < T > concatArray ( ObservableSource < ? extends T > ... sources ) { if ( sources . length == 0 ) { return empty ( ) ; } else if ( sources . length == 1 ) { return wrap ( ( ObservableSource < T > ) sources [ 0 ] ) ; } return RxJavaPlugins . onAssembly ( new ObservableConcatMap ( fromArray ( sources ) , Functions . identity ( ) , bufferSize ( ) , ErrorMode . BOUNDARY ) ) ;


signature:
public class Observable { /** * Concatenates a variable number of ObservableSource sources and delays errors from any of them
 * till all terminate .
 * < img width = " 640 " height = " 290 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / concatArray . png " alt = " " >
 * < dl >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code concatArrayDelayError } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param sources the array of sources
 * @ param < T > the common base value type
 * @ return the new Observable instance
 * @ throws NullPointerException if sources is null */
@ SuppressWarnings ( { } }

implementation: "unchecked" } ) @ CheckReturnValue @ SchedulerSupport ( SchedulerSupport . NONE ) public static < T > Observable < T > concatArrayDelayError ( ObservableSource < ? extends T > ... sources ) { if ( sources . length == 0 ) { return empty ( ) ; } else if ( sources . length == 1 ) { return ( Observable < T > ) wrap ( sources [ 0 ] ) ; } return concatDelayError ( fromArray ( sources ) ) ;


signature:
public class Observable { /** * Concatenates an array of ObservableSources eagerly into a single stream of values .
 * < img width = " 640 " height = " 410 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / concatArrayEager . png " alt = " " >
 * Eager concatenation means that once a subscriber subscribes , this operator subscribes to all of the
 * source ObservableSources . The operator buffers the values emitted by these ObservableSources and then drains them
 * in order , each one after the previous one completes .
 * < dl >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > This method does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param < T > the value type
 * @ param sources an array of ObservableSources that need to be eagerly concatenated
 * @ return the new ObservableSource instance with the specified concatenation behavior
 * @ since 2.0 */
@ CheckReturnValue @ SchedulerSupport ( SchedulerSupport . NONE ) public static < T > Observable < T > concatArrayEager ( ObservableSource < ? extends T > ... sources ) { } }

implementation: return concatArrayEager ( bufferSize ( ) , bufferSize ( ) , sources ) ;


signature:
public class Observable { /** * Concatenates an array of ObservableSources eagerly into a single stream of values .
 * < img width = " 640 " height = " 495 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / concatArrayEager . nn . png " alt = " " >
 * Eager concatenation means that once a subscriber subscribes , this operator subscribes to all of the
 * source ObservableSources . The operator buffers the values emitted by these ObservableSources and then drains them
 * in order , each one after the previous one completes .
 * < dl >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > This method does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param < T > the value type
 * @ param sources an array of ObservableSources that need to be eagerly concatenated
 * @ param maxConcurrency the maximum number of concurrent subscriptions at a time , Integer . MAX _ VALUE
 * is interpreted as indication to subscribe to all sources at once
 * @ param prefetch the number of elements to prefetch from each ObservableSource source
 * @ return the new ObservableSource instance with the specified concatenation behavior
 * @ since 2.0 */
@ SuppressWarnings ( { } }

implementation: "rawtypes" , "unchecked" } ) @ CheckReturnValue @ SchedulerSupport ( SchedulerSupport . NONE ) public static < T > Observable < T > concatArrayEager ( int maxConcurrency , int prefetch , ObservableSource < ? extends T > ... sources ) { return fromArray ( sources ) . concatMapEagerDelayError ( ( Function ) Functions . identity ( ) , maxConcurrency , prefetch , false ) ;


signature:
public class Observable { /** * Concatenates an array of { @ link ObservableSource } s eagerly into a single stream of values
 * and delaying any errors until all sources terminate .
 * < img width = " 640 " height = " 460 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / concatArrayEagerDelayError . nn . png " alt = " " >
 * Eager concatenation means that once a subscriber subscribes , this operator subscribes to all of the
 * source { @ code ObservableSource } s . The operator buffers the values emitted by these { @ code ObservableSource } s
 * and then drains them in order , each one after the previous one completes .
 * < dl >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > This method does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param < T > the value type
 * @ param sources an array of { @ code ObservableSource } s that need to be eagerly concatenated
 * @ param maxConcurrency the maximum number of concurrent subscriptions at a time , Integer . MAX _ VALUE
 * is interpreted as indication to subscribe to all sources at once
 * @ param prefetch the number of elements to prefetch from each { @ code ObservableSource } source
 * @ return the new Observable instance with the specified concatenation behavior
 * @ since 2.2.1 - experimental */
@ SuppressWarnings ( { } }

implementation: "rawtypes" , "unchecked" } ) @ CheckReturnValue @ SchedulerSupport ( SchedulerSupport . NONE ) public static < T > Observable < T > concatArrayEagerDelayError ( int maxConcurrency , int prefetch , ObservableSource < ? extends T > ... sources ) { return fromArray ( sources ) . concatMapEagerDelayError ( ( Function ) Functions . identity ( ) , maxConcurrency , prefetch , true ) ;


signature:
public class Observable { /** * Concatenates the ObservableSource sequence of ObservableSources into a single sequence by subscribing to each inner ObservableSource ,
 * one after the other , one at a time and delays any errors till the all inner and the outer ObservableSources terminate .
 * < img width = " 640 " height = " 380 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / concatDelayError . png " alt = " " >
 * < dl >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code concatDelayError } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param < T > the common element base type
 * @ param sources the ObservableSource sequence of ObservableSources
 * @ return the new ObservableSource with the concatenating behavior */
@ CheckReturnValue @ SchedulerSupport ( SchedulerSupport . NONE ) public static < T > Observable < T > concatDelayError ( ObservableSource < ? extends ObservableSource < ? extends T > > sources ) { } }

implementation: return concatDelayError ( sources , bufferSize ( ) , true ) ;


signature:
public class Observable { /** * Concatenates the ObservableSource sequence of ObservableSources into a single sequence by subscribing to each inner ObservableSource ,
 * one after the other , one at a time and delays any errors till the all inner and the outer ObservableSources terminate .
 * < img width = " 640 " height = " 380 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / concatDelayError . png " alt = " " >
 * < dl >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code concatDelayError } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param < T > the common element base type
 * @ param sources the ObservableSource sequence of ObservableSources
 * @ param prefetch the number of elements to prefetch from the outer ObservableSource
 * @ param tillTheEnd if true exceptions from the outer and all inner ObservableSources are delayed to the end
 * if false , exception from the outer ObservableSource is delayed till the current ObservableSource terminates
 * @ return the new ObservableSource with the concatenating behavior */
@ SuppressWarnings ( { } }

implementation: "rawtypes" , "unchecked" } ) @ CheckReturnValue @ NonNull @ SchedulerSupport ( SchedulerSupport . NONE ) public static < T > Observable < T > concatDelayError ( ObservableSource < ? extends ObservableSource < ? extends T > > sources , int prefetch , boolean tillTheEnd ) { ObjectHelper . requireNonNull ( sources , "sources is null" ) ; ObjectHelper . verifyPositive ( prefetch , "prefetch is null" ) ; return RxJavaPlugins . onAssembly ( new ObservableConcatMap ( sources , Functions . identity ( ) , prefetch , tillTheEnd ? ErrorMode . END : ErrorMode . BOUNDARY ) ) ;


signature:
public class Observable { /** * Concatenates an ObservableSource sequence of ObservableSources eagerly into a single stream of values .
 * Eager concatenation means that once a subscriber subscribes , this operator subscribes to all of the
 * emitted source ObservableSources as they are observed . The operator buffers the values emitted by these
 * ObservableSources and then drains them in order , each one after the previous one completes .
 * < img width = " 640 " height = " 380 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / concatEager . png " alt = " " >
 * < dl >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > This method does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param < T > the value type
 * @ param sources a sequence of ObservableSources that need to be eagerly concatenated
 * @ param maxConcurrency the maximum number of concurrently running inner ObservableSources ; Integer . MAX _ VALUE
 * is interpreted as all inner ObservableSources can be active at the same time
 * @ param prefetch the number of elements to prefetch from each inner ObservableSource source
 * @ return the new ObservableSource instance with the specified concatenation behavior
 * @ since 2.0 */
@ SuppressWarnings ( { } }

implementation: "unchecked" , "rawtypes" } ) @ CheckReturnValue @ SchedulerSupport ( SchedulerSupport . NONE ) public static < T > Observable < T > concatEager ( ObservableSource < ? extends ObservableSource < ? extends T > > sources , int maxConcurrency , int prefetch ) { return wrap ( sources ) . concatMapEager ( ( Function ) Functions . identity ( ) , maxConcurrency , prefetch ) ;


signature:
public class Observable { /** * Concatenates a sequence of ObservableSources eagerly into a single stream of values .
 * Eager concatenation means that once a subscriber subscribes , this operator subscribes to all of the
 * source ObservableSources . The operator buffers the values emitted by these ObservableSources and then drains them
 * in order , each one after the previous one completes .
 * < img width = " 640 " height = " 380 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / concatEager . png " alt = " " >
 * < dl >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > This method does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param < T > the value type
 * @ param sources a sequence of ObservableSources that need to be eagerly concatenated
 * @ param maxConcurrency the maximum number of concurrently running inner ObservableSources ; Integer . MAX _ VALUE
 * is interpreted as all inner ObservableSources can be active at the same time
 * @ param prefetch the number of elements to prefetch from each inner ObservableSource source
 * @ return the new ObservableSource instance with the specified concatenation behavior
 * @ since 2.0 */
@ SuppressWarnings ( { } }

implementation: "unchecked" , "rawtypes" } ) @ CheckReturnValue @ SchedulerSupport ( SchedulerSupport . NONE ) public static < T > Observable < T > concatEager ( Iterable < ? extends ObservableSource < ? extends T > > sources , int maxConcurrency , int prefetch ) { return fromIterable ( sources ) . concatMapEagerDelayError ( ( Function ) Functions . identity ( ) , maxConcurrency , prefetch , false ) ;


signature:
public class Observable { /** * Returns an Observable that emits no items to the { @ link Observer } and immediately invokes its
 * { @ link Observer # onComplete onComplete } method .
 * < img width = " 640 " height = " 190 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / empty . png " alt = " " >
 * < dl >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code empty } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param < T >
 * the type of the items ( ostensibly ) emitted by the ObservableSource
 * @ return an Observable that emits no items to the { @ link Observer } but immediately invokes the
 * { @ link Observer } ' s { @ link Observer # onComplete ( ) onComplete } method
 * @ see < a href = " http : / / reactivex . io / documentation / operators / empty - never - throw . html " > ReactiveX operators documentation : Empty < / a > */
@ CheckReturnValue @ SchedulerSupport ( SchedulerSupport . NONE ) @ SuppressWarnings ( "unchecked" ) public static < T > Observable < T > empty ( ) { } }

implementation: return RxJavaPlugins . onAssembly ( ( Observable < T > ) ObservableEmpty . INSTANCE ) ;


signature:
public class Observable { /** * Returns an Observable that invokes an { @ link Observer } ' s { @ link Observer # onError onError } method when the
 * Observer subscribes to it .
 * < img width = " 640 " height = " 220 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / error . supplier . png " alt = " " >
 * < dl >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code error } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param errorSupplier
 * a Callable factory to return a Throwable for each individual Observer
 * @ param < T >
 * the type of the items ( ostensibly ) emitted by the ObservableSource
 * @ return an Observable that invokes the { @ link Observer } ' s { @ link Observer # onError onError } method when
 * the Observer subscribes to it
 * @ see < a href = " http : / / reactivex . io / documentation / operators / empty - never - throw . html " > ReactiveX operators documentation : Throw < / a > */
@ CheckReturnValue @ NonNull @ SchedulerSupport ( SchedulerSupport . NONE ) public static < T > Observable < T > error ( Callable < ? extends Throwable > errorSupplier ) { } }

implementation: ObjectHelper . requireNonNull ( errorSupplier , "errorSupplier is null" ) ; return RxJavaPlugins . onAssembly ( new ObservableError < T > ( errorSupplier ) ) ;


signature:
public class Observable { /** * Converts an Array into an ObservableSource that emits the items in the Array .
 * < img width = " 640 " height = " 315 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / from . png " alt = " " >
 * < dl >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code fromArray } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param items
 * the array of elements
 * @ param < T >
 * the type of items in the Array and the type of items to be emitted by the resulting ObservableSource
 * @ return an Observable that emits each item in the source Array
 * @ see < a href = " http : / / reactivex . io / documentation / operators / from . html " > ReactiveX operators documentation : From < / a > */
@ CheckReturnValue @ SchedulerSupport ( SchedulerSupport . NONE ) @ NonNull public static < T > Observable < T > fromArray ( T ... items ) { } }

implementation: ObjectHelper . requireNonNull ( items , "items is null" ) ; if ( items . length == 0 ) { return empty ( ) ; } else if ( items . length == 1 ) { return just ( items [ 0 ] ) ; } return RxJavaPlugins . onAssembly ( new ObservableFromArray < T > ( items ) ) ;


signature:
public class Observable { /** * Converts an { @ link Iterable } sequence into an ObservableSource that emits the items in the sequence .
 * < img width = " 640 " height = " 186 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / fromIterable . png " alt = " " >
 * < dl >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code fromIterable } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param source
 * the source { @ link Iterable } sequence
 * @ param < T >
 * the type of items in the { @ link Iterable } sequence and the type of items to be emitted by the
 * resulting ObservableSource
 * @ return an Observable that emits each item in the source { @ link Iterable } sequence
 * @ see < a href = " http : / / reactivex . io / documentation / operators / from . html " > ReactiveX operators documentation : From < / a > */
@ CheckReturnValue @ NonNull @ SchedulerSupport ( SchedulerSupport . NONE ) public static < T > Observable < T > fromIterable ( Iterable < ? extends T > source ) { } }

implementation: ObjectHelper . requireNonNull ( source , "source is null" ) ; return RxJavaPlugins . onAssembly ( new ObservableFromIterable < T > ( source ) ) ;


signature:
public class Observable { /** * Converts an arbitrary Reactive - Streams Publisher into an Observable .
 * < img width = " 640 " height = " 344 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / fromPublisher . o . png " alt = " " >
 * The { @ link Publisher } must follow the
 * < a href = " https : / / github . com / reactive - streams / reactive - streams - jvm # reactive - streams " > Reactive - Streams specification < / a > .
 * Violating the specification may result in undefined behavior .
 * If possible , use { @ link # create ( ObservableOnSubscribe ) } to create a
 * source - like { @ code Observable } instead .
 * Note that even though { @ link Publisher } appears to be a functional interface , it
 * is not recommended to implement it through a lambda as the specification requires
 * state management that is not achievable with a stateless lambda .
 * < dl >
 * < dt > < b > Backpressure : < / b > < / dt >
 * < dd > The source { @ code publisher } is consumed in an unbounded fashion without applying any
 * backpressure to it . < / dd >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code fromPublisher } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param < T > the value type of the flow
 * @ param publisher the Publisher to convert
 * @ return the new Observable instance
 * @ throws NullPointerException if publisher is null
 * @ see # create ( ObservableOnSubscribe ) */
@ BackpressureSupport ( BackpressureKind . UNBOUNDED_IN ) @ CheckReturnValue @ NonNull @ SchedulerSupport ( SchedulerSupport . NONE ) public static < T > Observable < T > fromPublisher ( Publisher < ? extends T > publisher ) { } }

implementation: ObjectHelper . requireNonNull ( publisher , "publisher is null" ) ; return RxJavaPlugins . onAssembly ( new ObservableFromPublisher < T > ( publisher ) ) ;


signature:
public class Observable { /** * Returns a cold , synchronous and stateless generator of values .
 * < img width = " 640 " height = " 315 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / generate . 2 . png " alt = " " >
 * Note that the { @ link Emitter # onNext } , { @ link Emitter # onError } and
 * { @ link Emitter # onComplete } methods provided to the function via the { @ link Emitter } instance should be called synchronously ,
 * never concurrently and only while the function body is executing . Calling them from multiple threads
 * or outside the function call is not supported and leads to an undefined behavior .
 * < dl >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code generate } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param < T > the generated value type
 * @ param generator the Consumer called whenever a particular downstream Observer has
 * requested a value . The callback then should call { @ code onNext } , { @ code onError } or
 * { @ code onComplete } to signal a value or a terminal event . Signalling multiple { @ code onNext }
 * in a call will make the operator signal { @ code IllegalStateException } .
 * @ return the new Observable instance */
@ CheckReturnValue @ NonNull @ SchedulerSupport ( SchedulerSupport . NONE ) public static < T > Observable < T > generate ( final Consumer < Emitter < T > > generator ) { } }

implementation: ObjectHelper . requireNonNull ( generator , "generator is null" ) ; return generate ( Functions . < Object > nullSupplier ( ) , ObservableInternalHelper . simpleGenerator ( generator ) , Functions . < Object > emptyConsumer ( ) ) ;


signature:
public class Observable { /** * Returns a cold , synchronous and stateful generator of values .
 * < img width = " 640 " height = " 315 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / generate . 2 . png " alt = " " >
 * Note that the { @ link Emitter # onNext } , { @ link Emitter # onError } and
 * { @ link Emitter # onComplete } methods provided to the function via the { @ link Emitter } instance should be called synchronously ,
 * never concurrently and only while the function body is executing . Calling them from multiple threads
 * or outside the function call is not supported and leads to an undefined behavior .
 * < dl >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code generate } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param < S > the type of the per - Observer state
 * @ param < T > the generated value type
 * @ param initialState the Callable to generate the initial state for each Observer
 * @ param generator the Function called with the current state whenever a particular downstream Observer has
 * requested a value . The callback then should call { @ code onNext } , { @ code onError } or
 * { @ code onComplete } to signal a value or a terminal event and should return a ( new ) state for
 * the next invocation . Signalling multiple { @ code onNext }
 * in a call will make the operator signal { @ code IllegalStateException } .
 * @ return the new Observable instance */
@ CheckReturnValue @ SchedulerSupport ( SchedulerSupport . NONE ) public static < T , S > Observable < T > generate ( Callable < S > initialState , BiFunction < S , Emitter < T > , S > generator ) { } }

implementation: return generate ( initialState , generator , Functions . emptyConsumer ( ) ) ;


signature:
public class Observable { /** * Returns an Observable that emits a { @ code 0L } after the { @ code initialDelay } and ever increasing numbers
 * after each { @ code period } of time thereafter , on a specified { @ link Scheduler } .
 * < img width = " 640 " height = " 200 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / timer . ps . png " alt = " " >
 * < dl >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > You specify which { @ link Scheduler } this operator will use . < / dd >
 * < / dl >
 * @ param initialDelay
 * the initial delay time to wait before emitting the first value of 0L
 * @ param period
 * the period of time between emissions of the subsequent numbers
 * @ param unit
 * the time unit for both { @ code initialDelay } and { @ code period }
 * @ param scheduler
 * the Scheduler on which the waiting happens and items are emitted
 * @ return an Observable that emits a 0L after the { @ code initialDelay } and ever increasing numbers after
 * each { @ code period } of time thereafter , while running on the given Scheduler
 * @ see < a href = " http : / / reactivex . io / documentation / operators / interval . html " > ReactiveX operators documentation : Interval < / a >
 * @ since 1.0.12 */
@ CheckReturnValue @ NonNull @ SchedulerSupport ( SchedulerSupport . CUSTOM ) public static Observable < Long > interval ( long initialDelay , long period , TimeUnit unit , Scheduler scheduler ) { } }

implementation: ObjectHelper . requireNonNull ( unit , "unit is null" ) ; ObjectHelper . requireNonNull ( scheduler , "scheduler is null" ) ; return RxJavaPlugins . onAssembly ( new ObservableInterval ( Math . max ( 0L , initialDelay ) , Math . max ( 0L , period ) , unit , scheduler ) ) ;


signature:
public class Observable { /** * Returns an Observable that emits a sequential number every specified interval of time .
 * < img width = " 640 " height = " 195 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / interval . png " alt = " " >
 * < dl >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code interval } operates by default on the { @ code computation } { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param period
 * the period size in time units ( see below )
 * @ param unit
 * time units to use for the interval size
 * @ return an Observable that emits a sequential number each time interval
 * @ see < a href = " http : / / reactivex . io / documentation / operators / interval . html " > ReactiveX operators documentation : Interval < / a > */
@ CheckReturnValue @ SchedulerSupport ( SchedulerSupport . COMPUTATION ) public static Observable < Long > interval ( long period , TimeUnit unit ) { } }

implementation: return interval ( period , period , unit , Schedulers . computation ( ) ) ;


signature:
public class Observable { /** * Returns an Observable that emits a sequential number every specified interval of time , on a
 * specified Scheduler .
 * < img width = " 640 " height = " 200 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / interval . s . png " alt = " " >
 * < dl >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > You specify which { @ link Scheduler } this operator will use . < / dd >
 * < / dl >
 * @ param period
 * the period size in time units ( see below )
 * @ param unit
 * time units to use for the interval size
 * @ param scheduler
 * the Scheduler to use for scheduling the items
 * @ return an Observable that emits a sequential number each time interval
 * @ see < a href = " http : / / reactivex . io / documentation / operators / interval . html " > ReactiveX operators documentation : Interval < / a > */
@ CheckReturnValue @ SchedulerSupport ( SchedulerSupport . CUSTOM ) public static Observable < Long > interval ( long period , TimeUnit unit , Scheduler scheduler ) { } }

implementation: return interval ( period , period , unit , scheduler ) ;


signature:
public class Observable { /** * Signals a range of long values , the first after some initial delay and the rest periodically after .
 * The sequence completes immediately after the last value ( start + count - 1 ) has been reached .
 * < img width = " 640 " height = " 195 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / intervalRange . png " alt = " " >
 * < dl >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code intervalRange } by default operates on the { @ link Schedulers # computation ( ) computation } { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param start that start value of the range
 * @ param count the number of values to emit in total , if zero , the operator emits an onComplete after the initial delay .
 * @ param initialDelay the initial delay before signalling the first value ( the start )
 * @ param period the period between subsequent values
 * @ param unit the unit of measure of the initialDelay and period amounts
 * @ return the new Observable instance */
@ CheckReturnValue @ SchedulerSupport ( SchedulerSupport . COMPUTATION ) public static Observable < Long > intervalRange ( long start , long count , long initialDelay , long period , TimeUnit unit ) { } }

implementation: return intervalRange ( start , count , initialDelay , period , unit , Schedulers . computation ( ) ) ;


signature:
public class Observable { /** * Signals a range of long values , the first after some initial delay and the rest periodically after .
 * The sequence completes immediately after the last value ( start + count - 1 ) has been reached .
 * < img width = " 640 " height = " 195 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / intervalRange . s . png " alt = " " > * < dl >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > you provide the { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param start that start value of the range
 * @ param count the number of values to emit in total , if zero , the operator emits an onComplete after the initial delay .
 * @ param initialDelay the initial delay before signalling the first value ( the start )
 * @ param period the period between subsequent values
 * @ param unit the unit of measure of the initialDelay and period amounts
 * @ param scheduler the target scheduler where the values and terminal signals will be emitted
 * @ return the new Observable instance */
@ CheckReturnValue @ NonNull @ SchedulerSupport ( SchedulerSupport . CUSTOM ) public static Observable < Long > intervalRange ( long start , long count , long initialDelay , long period , TimeUnit unit , Scheduler scheduler ) { } }

implementation: if ( count < 0 ) { throw new IllegalArgumentException ( "count >= 0 required but it was " + count ) ; } if ( count == 0L ) { return Observable . < Long > empty ( ) . delay ( initialDelay , unit , scheduler ) ; } long end = start + ( count - 1 ) ; if ( start > 0 && end < 0 ) { throw new IllegalArgumentException ( "Overflow! start + count is bigger than Long.MAX_VALUE" ) ; } ObjectHelper . requireNonNull ( unit , "unit is null" ) ; ObjectHelper . requireNonNull ( scheduler , "scheduler is null" ) ; return RxJavaPlugins . onAssembly ( new ObservableIntervalRange ( start , end , Math . max ( 0L , initialDelay ) , Math . max ( 0L , period ) , unit , scheduler ) ) ;


signature:
public class Observable { /** * Returns an Observable that signals the given ( constant reference ) item and then completes .
 * < img width = " 640 " height = " 290 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / just . item . png " alt = " " >
 * Note that the item is taken and re - emitted as is and not computed by any means by { @ code just } . Use { @ link # fromCallable ( Callable ) }
 * to generate a single item on demand ( when { @ code Observer } s subscribe to it ) .
 * See the multi - parameter overloads of { @ code just } to emit more than one ( constant reference ) items one after the other .
 * Use { @ link # fromArray ( Object . . . ) } to emit an arbitrary number of items that are known upfront .
 * To emit the items of an { @ link Iterable } sequence ( such as a { @ link java . util . List } ) , use { @ link # fromIterable ( Iterable ) } .
 * < dl >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code just } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param item
 * the item to emit
 * @ param < T >
 * the type of that item
 * @ return an Observable that emits { @ code value } as a single item and then completes
 * @ see < a href = " http : / / reactivex . io / documentation / operators / just . html " > ReactiveX operators documentation : Just < / a >
 * @ see # just ( Object , Object )
 * @ see # fromCallable ( Callable )
 * @ see # fromArray ( Object . . . )
 * @ see # fromIterable ( Iterable ) */
@ CheckReturnValue @ NonNull @ SchedulerSupport ( SchedulerSupport . NONE ) public static < T > Observable < T > just ( T item ) { } }

implementation: ObjectHelper . requireNonNull ( item , "item is null" ) ; return RxJavaPlugins . onAssembly ( new ObservableJust < T > ( item ) ) ;


signature:
public class Observable { /** * Flattens an Iterable of ObservableSources into one ObservableSource , without any transformation , while limiting the
 * number of concurrent subscriptions to these ObservableSources .
 * < img width = " 640 " height = " 380 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / merge . png " alt = " " >
 * You can combine the items emitted by multiple ObservableSources so that they appear as a single ObservableSource , by
 * using the { @ code merge } method .
 * < dl >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code merge } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < dt > < b > Error handling : < / b > < / dt >
 * < dd > If any of the source { @ code ObservableSource } s signal a { @ code Throwable } via { @ code onError } , the resulting
 * { @ code Observable } terminates with that { @ code Throwable } and all other source { @ code ObservableSource } s are disposed .
 * If more than one { @ code ObservableSource } signals an error , the resulting { @ code Observable } may terminate with the
 * first one ' s error or , depending on the concurrency of the sources , may terminate with a
 * { @ code CompositeException } containing two or more of the various error signals .
 * { @ code Throwable } s that didn ' t make into the composite will be sent ( individually ) to the global error handler via
 * { @ link RxJavaPlugins # onError ( Throwable ) } method as { @ code UndeliverableException } errors . Similarly , { @ code Throwable } s
 * signaled by source ( s ) after the returned { @ code Observable } has been disposed or terminated with a
 * ( composite ) error will be sent to the same global error handler .
 * Use { @ link # mergeDelayError ( Iterable , int , int ) } to merge sources and terminate only when all source { @ code ObservableSource } s
 * have completed or failed with an error .
 * < / dd >
 * < / dl >
 * @ param < T > the common element base type
 * @ param sources
 * the Iterable of ObservableSources
 * @ param maxConcurrency
 * the maximum number of ObservableSources that may be subscribed to concurrently
 * @ param bufferSize
 * the number of items to prefetch from each inner ObservableSource
 * @ return an Observable that emits items that are the result of flattening the items emitted by the
 * ObservableSources in the Iterable
 * @ throws IllegalArgumentException
 * if { @ code maxConcurrent } is less than or equal to 0
 * @ see < a href = " http : / / reactivex . io / documentation / operators / merge . html " > ReactiveX operators documentation : Merge < / a >
 * @ see # mergeDelayError ( Iterable , int , int ) */
@ SuppressWarnings ( { } }

implementation: "unchecked" , "rawtypes" } ) @ CheckReturnValue @ SchedulerSupport ( SchedulerSupport . NONE ) public static < T > Observable < T > merge ( Iterable < ? extends ObservableSource < ? extends T > > sources , int maxConcurrency , int bufferSize ) { return fromIterable ( sources ) . flatMap ( ( Function ) Functions . identity ( ) , false , maxConcurrency , bufferSize ) ;


signature:
public class Observable { /** * Flattens an Iterable of ObservableSources into one ObservableSource , without any transformation , while limiting the
 * number of concurrent subscriptions to these ObservableSources .
 * < img width = " 640 " height = " 380 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / merge . png " alt = " " >
 * You can combine the items emitted by multiple ObservableSources so that they appear as a single ObservableSource , by
 * using the { @ code merge } method .
 * < dl >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code mergeArray } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < dt > < b > Error handling : < / b > < / dt >
 * < dd > If any of the source { @ code ObservableSource } s signal a { @ code Throwable } via { @ code onError } , the resulting
 * { @ code Observable } terminates with that { @ code Throwable } and all other source { @ code ObservableSource } s are disposed .
 * If more than one { @ code ObservableSource } signals an error , the resulting { @ code Observable } may terminate with the
 * first one ' s error or , depending on the concurrency of the sources , may terminate with a
 * { @ code CompositeException } containing two or more of the various error signals .
 * { @ code Throwable } s that didn ' t make into the composite will be sent ( individually ) to the global error handler via
 * { @ link RxJavaPlugins # onError ( Throwable ) } method as { @ code UndeliverableException } errors . Similarly , { @ code Throwable } s
 * signaled by source ( s ) after the returned { @ code Observable } has been disposed or terminated with a
 * ( composite ) error will be sent to the same global error handler .
 * Use { @ link # mergeArrayDelayError ( int , int , ObservableSource . . . ) } to merge sources and terminate only when all source { @ code ObservableSource } s
 * have completed or failed with an error .
 * < / dd >
 * < / dl >
 * @ param < T > the common element base type
 * @ param sources
 * the array of ObservableSources
 * @ param maxConcurrency
 * the maximum number of ObservableSources that may be subscribed to concurrently
 * @ param bufferSize
 * the number of items to prefetch from each inner ObservableSource
 * @ return an Observable that emits items that are the result of flattening the items emitted by the
 * ObservableSources in the Iterable
 * @ throws IllegalArgumentException
 * if { @ code maxConcurrent } is less than or equal to 0
 * @ see < a href = " http : / / reactivex . io / documentation / operators / merge . html " > ReactiveX operators documentation : Merge < / a >
 * @ see # mergeArrayDelayError ( int , int , ObservableSource . . . ) */
@ SuppressWarnings ( { } }

implementation: "unchecked" , "rawtypes" } ) @ CheckReturnValue @ SchedulerSupport ( SchedulerSupport . NONE ) public static < T > Observable < T > mergeArray ( int maxConcurrency , int bufferSize , ObservableSource < ? extends T > ... sources ) { return fromArray ( sources ) . flatMap ( ( Function ) Functions . identity ( ) , false , maxConcurrency , bufferSize ) ;


signature:
public class Observable { /** * Flattens an ObservableSource that emits ObservableSources into a single ObservableSource that emits the items emitted by
 * those ObservableSources , without any transformation .
 * < img width = " 640 " height = " 370 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / merge . oo . png " alt = " " >
 * You can combine the items emitted by multiple ObservableSources so that they appear as a single ObservableSource , by
 * using the { @ code merge } method .
 * < dl >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code merge } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < dt > < b > Error handling : < / b > < / dt >
 * < dd > If any of the source { @ code ObservableSource } s signal a { @ code Throwable } via { @ code onError } , the resulting
 * { @ code Observable } terminates with that { @ code Throwable } and all other source { @ code ObservableSource } s are disposed .
 * If more than one { @ code ObservableSource } signals an error , the resulting { @ code Observable } may terminate with the
 * first one ' s error or , depending on the concurrency of the sources , may terminate with a
 * { @ code CompositeException } containing two or more of the various error signals .
 * { @ code Throwable } s that didn ' t make into the composite will be sent ( individually ) to the global error handler via
 * { @ link RxJavaPlugins # onError ( Throwable ) } method as { @ code UndeliverableException } errors . Similarly , { @ code Throwable } s
 * signaled by source ( s ) after the returned { @ code Observable } has been disposed or terminated with a
 * ( composite ) error will be sent to the same global error handler .
 * Use { @ link # mergeDelayError ( ObservableSource ) } to merge sources and terminate only when all source { @ code ObservableSource } s
 * have completed or failed with an error .
 * < / dd >
 * < / dl >
 * @ param < T > the common element base type
 * @ param sources
 * an ObservableSource that emits ObservableSources
 * @ return an Observable that emits items that are the result of flattening the ObservableSources emitted by the
 * { @ code source } ObservableSource
 * @ see < a href = " http : / / reactivex . io / documentation / operators / merge . html " > ReactiveX operators documentation : Merge < / a >
 * @ see # mergeDelayError ( ObservableSource ) */
@ CheckReturnValue @ SchedulerSupport ( SchedulerSupport . NONE ) @ SuppressWarnings ( { } }

implementation: "unchecked" , "rawtypes" } ) public static < T > Observable < T > merge ( ObservableSource < ? extends ObservableSource < ? extends T > > sources ) { ObjectHelper . requireNonNull ( sources , "sources is null" ) ; return RxJavaPlugins . onAssembly ( new ObservableFlatMap ( sources , Functions . identity ( ) , false , Integer . MAX_VALUE , bufferSize ( ) ) ) ;


signature:
public class Observable { /** * Flattens an Array of ObservableSources into one ObservableSource , without any transformation .
 * < img width = " 640 " height = " 370 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / merge . io . png " alt = " " >
 * You can combine items emitted by multiple ObservableSources so that they appear as a single ObservableSource , by
 * using the { @ code merge } method .
 * < dl >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code mergeArray } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < dt > < b > Error handling : < / b > < / dt >
 * < dd > If any of the source { @ code ObservableSource } s signal a { @ code Throwable } via { @ code onError } , the resulting
 * { @ code Observable } terminates with that { @ code Throwable } and all other source { @ code ObservableSource } s are disposed .
 * If more than one { @ code ObservableSource } signals an error , the resulting { @ code Observable } may terminate with the
 * first one ' s error or , depending on the concurrency of the sources , may terminate with a
 * { @ code CompositeException } containing two or more of the various error signals .
 * { @ code Throwable } s that didn ' t make into the composite will be sent ( individually ) to the global error handler via
 * { @ link RxJavaPlugins # onError ( Throwable ) } method as { @ code UndeliverableException } errors . Similarly , { @ code Throwable } s
 * signaled by source ( s ) after the returned { @ code Observable } has been disposed or terminated with a
 * ( composite ) error will be sent to the same global error handler .
 * Use { @ link # mergeArrayDelayError ( ObservableSource . . . ) } to merge sources and terminate only when all source { @ code ObservableSource } s
 * have completed or failed with an error .
 * < / dd >
 * < / dl >
 * @ param < T > the common element base type
 * @ param sources
 * the array of ObservableSources
 * @ return an Observable that emits all of the items emitted by the ObservableSources in the Array
 * @ see < a href = " http : / / reactivex . io / documentation / operators / merge . html " > ReactiveX operators documentation : Merge < / a >
 * @ see # mergeArrayDelayError ( ObservableSource . . . ) */
@ SuppressWarnings ( { } }

implementation: "unchecked" , "rawtypes" } ) @ CheckReturnValue @ SchedulerSupport ( SchedulerSupport . NONE ) public static < T > Observable < T > mergeArray ( ObservableSource < ? extends T > ... sources ) { return fromArray ( sources ) . flatMap ( ( Function ) Functions . identity ( ) , sources . length ) ;


signature:
public class Observable { /** * Flattens three ObservableSources into one ObservableSource , in a way that allows an Observer to receive all
 * successfully emitted items from all of the source ObservableSources without being interrupted by an error
 * notification from one of them .
 * This behaves like { @ link # merge ( ObservableSource , ObservableSource , ObservableSource ) } except that if any of the merged
 * ObservableSources notify of an error via { @ link Observer # onError onError } , { @ code mergeDelayError } will refrain
 * from propagating that error notification until all of the merged ObservableSources have finished emitting
 * items .
 * < img width = " 640 " height = " 380 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / mergeDelayError . png " alt = " " >
 * Even if multiple merged ObservableSources send { @ code onError } notifications , { @ code mergeDelayError } will only
 * invoke the { @ code onError } method of its Observers once .
 * < dl >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code mergeDelayError } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param < T > the common element base type
 * @ param source1
 * an ObservableSource to be merged
 * @ param source2
 * an ObservableSource to be merged
 * @ param source3
 * an ObservableSource to be merged
 * @ return an Observable that emits all of the items that are emitted by the source ObservableSources
 * @ see < a href = " http : / / reactivex . io / documentation / operators / merge . html " > ReactiveX operators documentation : Merge < / a > */
@ SuppressWarnings ( { } }

implementation: "unchecked" , "rawtypes" } ) @ CheckReturnValue @ SchedulerSupport ( SchedulerSupport . NONE ) public static < T > Observable < T > mergeDelayError ( ObservableSource < ? extends T > source1 , ObservableSource < ? extends T > source2 , ObservableSource < ? extends T > source3 ) { ObjectHelper . requireNonNull ( source1 , "source1 is null" ) ; ObjectHelper . requireNonNull ( source2 , "source2 is null" ) ; ObjectHelper . requireNonNull ( source3 , "source3 is null" ) ; return fromArray ( source1 , source2 , source3 ) . flatMap ( ( Function ) Functions . identity ( ) , true , 3 ) ;


signature:
public class Observable { /** * Returns an Observable that never sends any items or notifications to an { @ link Observer } .
 * < img width = " 640 " height = " 185 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / never . png " alt = " " >
 * This ObservableSource is useful primarily for testing purposes .
 * < dl >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code never } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param < T >
 * the type of items ( not ) emitted by the ObservableSource
 * @ return an Observable that never emits any items or sends any notifications to an { @ link Observer }
 * @ see < a href = " http : / / reactivex . io / documentation / operators / empty - never - throw . html " > ReactiveX operators documentation : Never < / a > */
@ CheckReturnValue @ SchedulerSupport ( SchedulerSupport . NONE ) @ SuppressWarnings ( "unchecked" ) public static < T > Observable < T > never ( ) { } }

implementation: return RxJavaPlugins . onAssembly ( ( Observable < T > ) ObservableNever . INSTANCE ) ;


signature:
public class Observable { /** * Returns an Observable that emits a sequence of Integers within a specified range .
 * < img width = " 640 " height = " 195 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / range . png " alt = " " >
 * < dl >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code range } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param start
 * the value of the first Integer in the sequence
 * @ param count
 * the number of sequential Integers to generate
 * @ return an Observable that emits a range of sequential Integers
 * @ throws IllegalArgumentException
 * if { @ code count } is less than zero , or if { @ code start } + { @ code count } & minus ; 1 exceeds
 * { @ code Integer . MAX _ VALUE }
 * @ see < a href = " http : / / reactivex . io / documentation / operators / range . html " > ReactiveX operators documentation : Range < / a > */
@ CheckReturnValue @ SchedulerSupport ( SchedulerSupport . NONE ) public static Observable < Integer > range ( final int start , final int count ) { } }

implementation: if ( count < 0 ) { throw new IllegalArgumentException ( "count >= 0 required but it was " + count ) ; } if ( count == 0 ) { return empty ( ) ; } if ( count == 1 ) { return just ( start ) ; } if ( ( long ) start + ( count - 1 ) > Integer . MAX_VALUE ) { throw new IllegalArgumentException ( "Integer overflow" ) ; } return RxJavaPlugins . onAssembly ( new ObservableRange ( start , count ) ) ;


signature:
public class Observable { /** * Returns an Observable that emits a sequence of Longs within a specified range .
 * < img width = " 640 " height = " 195 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / rangeLong . png " alt = " " >
 * < dl >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code rangeLong } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param start
 * the value of the first Long in the sequence
 * @ param count
 * the number of sequential Longs to generate
 * @ return an Observable that emits a range of sequential Longs
 * @ throws IllegalArgumentException
 * if { @ code count } is less than zero , or if { @ code start } + { @ code count } & minus ; 1 exceeds
 * { @ code Long . MAX _ VALUE }
 * @ see < a href = " http : / / reactivex . io / documentation / operators / range . html " > ReactiveX operators documentation : Range < / a > */
@ CheckReturnValue @ SchedulerSupport ( SchedulerSupport . NONE ) public static Observable < Long > rangeLong ( long start , long count ) { } }

implementation: if ( count < 0 ) { throw new IllegalArgumentException ( "count >= 0 required but it was " + count ) ; } if ( count == 0 ) { return empty ( ) ; } if ( count == 1 ) { return just ( start ) ; } long end = start + ( count - 1 ) ; if ( start > 0 && end < 0 ) { throw new IllegalArgumentException ( "Overflow! start + count is bigger than Long.MAX_VALUE" ) ; } return RxJavaPlugins . onAssembly ( new ObservableRangeLong ( start , count ) ) ;


signature:
public class Observable { /** * Returns a Single that emits a Boolean value that indicates whether two ObservableSource sequences are the
 * same by comparing the items emitted by each ObservableSource pairwise based on the results of a specified
 * equality function .
 * < img width = " 640 " height = " 380 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / sequenceEqual . 2 . png " alt = " " >
 * < dl >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code sequenceEqual } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param source1
 * the first ObservableSource to compare
 * @ param source2
 * the second ObservableSource to compare
 * @ param isEqual
 * a function used to compare items emitted by each ObservableSource
 * @ param < T >
 * the type of items emitted by each ObservableSource
 * @ return a Single that emits a Boolean value that indicates whether the two ObservableSource two sequences
 * are the same according to the specified function
 * @ see < a href = " http : / / reactivex . io / documentation / operators / sequenceequal . html " > ReactiveX operators documentation : SequenceEqual < / a > */
@ CheckReturnValue @ SchedulerSupport ( SchedulerSupport . NONE ) public static < T > Single < Boolean > sequenceEqual ( ObservableSource < ? extends T > source1 , ObservableSource < ? extends T > source2 , BiPredicate < ? super T , ? super T > isEqual ) { } }

implementation: return sequenceEqual ( source1 , source2 , isEqual , bufferSize ( ) ) ;


signature:
public class Observable { /** * Returns a Single that emits a Boolean value that indicates whether two ObservableSource sequences are the
 * same by comparing the items emitted by each ObservableSource pairwise based on the results of a specified
 * equality function .
 * < img width = " 640 " height = " 380 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / sequenceEqual . 2 . png " alt = " " >
 * < dl >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code sequenceEqual } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param source1
 * the first ObservableSource to compare
 * @ param source2
 * the second ObservableSource to compare
 * @ param isEqual
 * a function used to compare items emitted by each ObservableSource
 * @ param bufferSize
 * the number of items to prefetch from the first and second source ObservableSource
 * @ param < T >
 * the type of items emitted by each ObservableSource
 * @ return an Observable that emits a Boolean value that indicates whether the two ObservableSource two sequences
 * are the same according to the specified function
 * @ see < a href = " http : / / reactivex . io / documentation / operators / sequenceequal . html " > ReactiveX operators documentation : SequenceEqual < / a > */
@ CheckReturnValue @ SchedulerSupport ( SchedulerSupport . NONE ) public static < T > Single < Boolean > sequenceEqual ( ObservableSource < ? extends T > source1 , ObservableSource < ? extends T > source2 , BiPredicate < ? super T , ? super T > isEqual , int bufferSize ) { } }

implementation: ObjectHelper . requireNonNull ( source1 , "source1 is null" ) ; ObjectHelper . requireNonNull ( source2 , "source2 is null" ) ; ObjectHelper . requireNonNull ( isEqual , "isEqual is null" ) ; ObjectHelper . verifyPositive ( bufferSize , "bufferSize" ) ; return RxJavaPlugins . onAssembly ( new ObservableSequenceEqualSingle < T > ( source1 , source2 , isEqual , bufferSize ) ) ;


signature:
public class Observable { /** * Returns a Single that emits a Boolean value that indicates whether two ObservableSource sequences are the
 * same by comparing the items emitted by each ObservableSource pairwise .
 * < img width = " 640 " height = " 380 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / sequenceEqual . 2 . png " alt = " " >
 * < dl >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code sequenceEqual } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param source1
 * the first ObservableSource to compare
 * @ param source2
 * the second ObservableSource to compare
 * @ param bufferSize
 * the number of items to prefetch from the first and second source ObservableSource
 * @ param < T >
 * the type of items emitted by each ObservableSource
 * @ return a Single that emits a Boolean value that indicates whether the two sequences are the same
 * @ see < a href = " http : / / reactivex . io / documentation / operators / sequenceequal . html " > ReactiveX operators documentation : SequenceEqual < / a > */
@ CheckReturnValue @ SchedulerSupport ( SchedulerSupport . NONE ) public static < T > Single < Boolean > sequenceEqual ( ObservableSource < ? extends T > source1 , ObservableSource < ? extends T > source2 , int bufferSize ) { } }

implementation: return sequenceEqual ( source1 , source2 , ObjectHelper . equalsPredicate ( ) , bufferSize ) ;


signature:
public class Observable { /** * Converts an ObservableSource that emits ObservableSources into an ObservableSource that emits the items emitted by the
 * most recently emitted of those ObservableSources .
 * < img width = " 640 " height = " 370 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / switchDo . png " alt = " " >
 * { @ code switchOnNext } subscribes to an ObservableSource that emits ObservableSources . Each time it observes one of
 * these emitted ObservableSources , the ObservableSource returned by { @ code switchOnNext } begins emitting the items
 * emitted by that ObservableSource . When a new ObservableSource is emitted , { @ code switchOnNext } stops emitting items
 * from the earlier - emitted ObservableSource and begins emitting items from the new one .
 * The resulting ObservableSource completes if both the outer ObservableSource and the last inner ObservableSource , if any , complete .
 * If the outer ObservableSource signals an onError , the inner ObservableSource is disposed and the error delivered in - sequence .
 * < dl >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code switchOnNext } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param < T > the item type
 * @ param sources
 * the source ObservableSource that emits ObservableSources
 * @ param bufferSize
 * the number of items to prefetch from the inner ObservableSources
 * @ return an Observable that emits the items emitted by the ObservableSource most recently emitted by the source
 * ObservableSource
 * @ see < a href = " http : / / reactivex . io / documentation / operators / switch . html " > ReactiveX operators documentation : Switch < / a > */
@ SuppressWarnings ( { } }

implementation: "rawtypes" , "unchecked" } ) @ CheckReturnValue @ SchedulerSupport ( SchedulerSupport . NONE ) public static < T > Observable < T > switchOnNext ( ObservableSource < ? extends ObservableSource < ? extends T > > sources , int bufferSize ) { ObjectHelper . requireNonNull ( sources , "sources is null" ) ; ObjectHelper . verifyPositive ( bufferSize , "bufferSize" ) ; return RxJavaPlugins . onAssembly ( new ObservableSwitchMap ( sources , Functions . identity ( ) , bufferSize , false ) ) ;


signature:
public class Observable { /** * Converts an ObservableSource that emits ObservableSources into an ObservableSource that emits the items emitted by the
 * most recently emitted of those ObservableSources and delays any exception until all ObservableSources terminate .
 * < img width = " 640 " height = " 370 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / switchOnNextDelayError . png " alt = " " >
 * { @ code switchOnNext } subscribes to an ObservableSource that emits ObservableSources . Each time it observes one of
 * these emitted ObservableSources , the ObservableSource returned by { @ code switchOnNext } begins emitting the items
 * emitted by that ObservableSource . When a new ObservableSource is emitted , { @ code switchOnNext } stops emitting items
 * from the earlier - emitted ObservableSource and begins emitting items from the new one .
 * The resulting ObservableSource completes if both the main ObservableSource and the last inner ObservableSource , if any , complete .
 * If the main ObservableSource signals an onError , the termination of the last inner ObservableSource will emit that error as is
 * or wrapped into a CompositeException along with the other possible errors the former inner ObservableSources signalled .
 * < dl >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code switchOnNextDelayError } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param < T > the item type
 * @ param sources
 * the source ObservableSource that emits ObservableSources
 * @ param prefetch
 * the number of items to prefetch from the inner ObservableSources
 * @ return an Observable that emits the items emitted by the ObservableSource most recently emitted by the source
 * ObservableSource
 * @ see < a href = " http : / / reactivex . io / documentation / operators / switch . html " > ReactiveX operators documentation : Switch < / a >
 * @ since 2.0 */
@ SuppressWarnings ( { } }

implementation: "rawtypes" , "unchecked" } ) @ CheckReturnValue @ SchedulerSupport ( SchedulerSupport . NONE ) public static < T > Observable < T > switchOnNextDelayError ( ObservableSource < ? extends ObservableSource < ? extends T > > sources , int prefetch ) { ObjectHelper . requireNonNull ( sources , "sources is null" ) ; ObjectHelper . verifyPositive ( prefetch , "prefetch" ) ; return RxJavaPlugins . onAssembly ( new ObservableSwitchMap ( sources , Functions . identity ( ) , prefetch , true ) ) ;


signature:
public class Observable { /** * Create an Observable by wrapping an ObservableSource < em > which has to be implemented according
 * to the Reactive - Streams - based Observable specification by handling
 * disposal correctly ; no safeguards are provided by the Observable itself < / em > .
 * < dl >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code unsafeCreate } by default doesn ' t operate on any particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param < T > the value type emitted
 * @ param onSubscribe the ObservableSource instance to wrap
 * @ return the new Observable instance */
@ CheckReturnValue @ SchedulerSupport ( SchedulerSupport . NONE ) public static < T > Observable < T > unsafeCreate ( ObservableSource < T > onSubscribe ) { } }

implementation: ObjectHelper . requireNonNull ( onSubscribe , "onSubscribe is null" ) ; if ( onSubscribe instanceof Observable ) { throw new IllegalArgumentException ( "unsafeCreate(Observable) should be upgraded" ) ; } return RxJavaPlugins . onAssembly ( new ObservableFromUnsafeSource < T > ( onSubscribe ) ) ;


signature:
public class Observable { /** * Constructs an ObservableSource that creates a dependent resource object which is disposed of when the downstream
 * calls dispose ( ) .
 * < img width = " 640 " height = " 400 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / using . png " alt = " " >
 * < dl >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code using } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param < T > the element type of the generated ObservableSource
 * @ param < D > the type of the resource associated with the output sequence
 * @ param resourceSupplier
 * the factory function to create a resource object that depends on the ObservableSource
 * @ param sourceSupplier
 * the factory function to create an ObservableSource
 * @ param disposer
 * the function that will dispose of the resource
 * @ return the ObservableSource whose lifetime controls the lifetime of the dependent resource object
 * @ see < a href = " http : / / reactivex . io / documentation / operators / using . html " > ReactiveX operators documentation : Using < / a > */
@ CheckReturnValue @ SchedulerSupport ( SchedulerSupport . NONE ) public static < T , D > Observable < T > using ( Callable < ? extends D > resourceSupplier , Function < ? super D , ? extends ObservableSource < ? extends T > > sourceSupplier , Consumer < ? super D > disposer ) { } }

implementation: return using ( resourceSupplier , sourceSupplier , disposer , true ) ;


signature:
public class Observable { /** * Constructs an ObservableSource that creates a dependent resource object which is disposed of just before
 * termination if you have set { @ code disposeEagerly } to { @ code true } and a dispose ( ) call does not occur
 * before termination . Otherwise resource disposal will occur on a dispose ( ) call . Eager disposal is
 * particularly appropriate for a synchronous ObservableSource that reuses resources . { @ code disposeAction } will
 * only be called once per subscription .
 * < img width = " 640 " height = " 400 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / using . png " alt = " " >
 * < dl >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code using } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param < T > the element type of the generated ObservableSource
 * @ param < D > the type of the resource associated with the output sequence
 * @ param resourceSupplier
 * the factory function to create a resource object that depends on the ObservableSource
 * @ param sourceSupplier
 * the factory function to create an ObservableSource
 * @ param disposer
 * the function that will dispose of the resource
 * @ param eager
 * if { @ code true } then disposal will happen either on a dispose ( ) call or just before emission of
 * a terminal event ( { @ code onComplete } or { @ code onError } ) .
 * @ return the ObservableSource whose lifetime controls the lifetime of the dependent resource object
 * @ see < a href = " http : / / reactivex . io / documentation / operators / using . html " > ReactiveX operators documentation : Using < / a >
 * @ since 2.0 */
@ CheckReturnValue @ SchedulerSupport ( SchedulerSupport . NONE ) public static < T , D > Observable < T > using ( Callable < ? extends D > resourceSupplier , Function < ? super D , ? extends ObservableSource < ? extends T > > sourceSupplier , Consumer < ? super D > disposer , boolean eager ) { } }

implementation: ObjectHelper . requireNonNull ( resourceSupplier , "resourceSupplier is null" ) ; ObjectHelper . requireNonNull ( sourceSupplier , "sourceSupplier is null" ) ; ObjectHelper . requireNonNull ( disposer , "disposer is null" ) ; return RxJavaPlugins . onAssembly ( new ObservableUsing < T , D > ( resourceSupplier , sourceSupplier , disposer , eager ) ) ;


signature:
public class Observable { /** * Wraps an ObservableSource into an Observable if not already an Observable .
 * < dl >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code wrap } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param < T > the value type
 * @ param source the source ObservableSource instance
 * @ return the new Observable instance or the same as the source
 * @ throws NullPointerException if source is null */
@ CheckReturnValue @ SchedulerSupport ( SchedulerSupport . NONE ) public static < T > Observable < T > wrap ( ObservableSource < T > source ) { } }

implementation: ObjectHelper . requireNonNull ( source , "source is null" ) ; if ( source instanceof Observable ) { return RxJavaPlugins . onAssembly ( ( Observable < T > ) source ) ; } return RxJavaPlugins . onAssembly ( new ObservableFromUnsafeSource < T > ( source ) ) ;


signature:
public class Observable { /** * Returns an Observable that emits the results of a specified combiner function applied to combinations of
 * items emitted , in sequence , by an Iterable of other ObservableSources .
 * { @ code zip } applies this function in strict sequence , so the first item emitted by the new ObservableSource
 * will be the result of the function applied to the first item emitted by each of the source ObservableSources ;
 * the second item emitted by the new ObservableSource will be the result of the function applied to the second
 * item emitted by each of those ObservableSources ; and so forth .
 * The resulting { @ code ObservableSource < R > } returned from { @ code zip } will invoke { @ code onNext } as many times as
 * the number of { @ code onNext } invocations of the source ObservableSource that emits the fewest items .
 * The operator subscribes to its sources in order they are specified and completes eagerly if
 * one of the sources is shorter than the rest while disposing the other sources . Therefore , it
 * is possible those other sources will never be able to run to completion ( and thus not calling
 * { @ code doOnComplete ( ) } ) . This can also happen if the sources are exactly the same length ; if
 * source A completes and B has been consumed and is about to complete , the operator detects A won ' t
 * be sending further values and it will dispose B immediately . For example :
 * < pre > < code > zip ( Arrays . asList ( range ( 1 , 5 ) . doOnComplete ( action1 ) , range ( 6 , 5 ) . doOnComplete ( action2 ) ) , ( a ) - & gt ; a ) < / code > < / pre >
 * { @ code action1 } will be called but { @ code action2 } won ' t .
 * < br > To work around this termination property ,
 * use { @ link # doOnDispose ( Action ) } as well or use { @ code using ( ) } to do cleanup in case of completion
 * or a dispose ( ) call .
 * Note on method signature : since Java doesn ' t allow creating a generic array with { @ code new T [ ] } , the
 * implementation of this operator has to create an { @ code Object [ ] } instead . Unfortunately , a
 * { @ code Function < Integer [ ] , R > } passed to the method would trigger a { @ code ClassCastException } .
 * < img width = " 640 " height = " 380 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / zip . png " alt = " " >
 * < dl >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code zip } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param < T > the common value type
 * @ param < R > the zipped result type
 * @ param sources
 * an Iterable of source ObservableSources
 * @ param zipper
 * a function that , when applied to an item emitted by each of the source ObservableSources , results in
 * an item that will be emitted by the resulting ObservableSource
 * @ return an Observable that emits the zipped results
 * @ see < a href = " http : / / reactivex . io / documentation / operators / zip . html " > ReactiveX operators documentation : Zip < / a > */
@ CheckReturnValue @ SchedulerSupport ( SchedulerSupport . NONE ) public static < T , R > Observable < R > zip ( Iterable < ? extends ObservableSource < ? extends T > > sources , Function < ? super Object [ ] , ? extends R > zipper ) { } }

implementation: ObjectHelper . requireNonNull ( zipper , "zipper is null" ) ; ObjectHelper . requireNonNull ( sources , "sources is null" ) ; return RxJavaPlugins . onAssembly ( new ObservableZip < T , R > ( null , sources , zipper , bufferSize ( ) , false ) ) ;


signature:
public class Observable { /** * Returns an Observable that emits the results of a specified combiner function applied to combinations of
 * < i > n < / i > items emitted , in sequence , by the < i > n < / i > ObservableSources emitted by a specified ObservableSource .
 * { @ code zip } applies this function in strict sequence , so the first item emitted by the new ObservableSource
 * will be the result of the function applied to the first item emitted by each of the ObservableSources emitted
 * by the source ObservableSource ; the second item emitted by the new ObservableSource will be the result of the
 * function applied to the second item emitted by each of those ObservableSources ; and so forth .
 * The resulting { @ code ObservableSource < R > } returned from { @ code zip } will invoke { @ code onNext } as many times as
 * the number of { @ code onNext } invocations of the source ObservableSource that emits the fewest items .
 * The operator subscribes to its sources in order they are specified and completes eagerly if
 * one of the sources is shorter than the rest while disposing the other sources . Therefore , it
 * is possible those other sources will never be able to run to completion ( and thus not calling
 * { @ code doOnComplete ( ) } ) . This can also happen if the sources are exactly the same length ; if
 * source A completes and B has been consumed and is about to complete , the operator detects A won ' t
 * be sending further values and it will dispose B immediately . For example :
 * < pre > < code > zip ( just ( range ( 1 , 5 ) . doOnComplete ( action1 ) , range ( 6 , 5 ) . doOnComplete ( action2 ) ) , ( a ) - & gt ; a ) < / code > < / pre >
 * { @ code action1 } will be called but { @ code action2 } won ' t .
 * < br > To work around this termination property ,
 * use { @ link # doOnDispose ( Action ) } as well or use { @ code using ( ) } to do cleanup in case of completion
 * or a dispose ( ) call .
 * Note on method signature : since Java doesn ' t allow creating a generic array with { @ code new T [ ] } , the
 * implementation of this operator has to create an { @ code Object [ ] } instead . Unfortunately , a
 * { @ code Function < Integer [ ] , R > } passed to the method would trigger a { @ code ClassCastException } .
 * < img width = " 640 " height = " 370 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / zip . o . png " alt = " " >
 * < dl >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code zip } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param < T > the value type of the inner ObservableSources
 * @ param < R > the zipped result type
 * @ param sources
 * an ObservableSource of source ObservableSources
 * @ param zipper
 * a function that , when applied to an item emitted by each of the ObservableSources emitted by
 * { @ code ws } , results in an item that will be emitted by the resulting ObservableSource
 * @ return an Observable that emits the zipped results
 * @ see < a href = " http : / / reactivex . io / documentation / operators / zip . html " > ReactiveX operators documentation : Zip < / a > */
@ SuppressWarnings ( { } }

implementation: "rawtypes" , "unchecked" } ) @ CheckReturnValue @ SchedulerSupport ( SchedulerSupport . NONE ) public static < T , R > Observable < R > zip ( ObservableSource < ? extends ObservableSource < ? extends T > > sources , final Function < ? super Object [ ] , ? extends R > zipper ) { ObjectHelper . requireNonNull ( zipper , "zipper is null" ) ; ObjectHelper . requireNonNull ( sources , "sources is null" ) ; return RxJavaPlugins . onAssembly ( new ObservableToList ( sources , 16 ) . flatMap ( ObservableInternalHelper . zipIterable ( zipper ) ) ) ;


signature:
public class Observable { /** * Returns an Observable that emits the results of a specified combiner function applied to combinations of
 * items emitted , in sequence , by an array of other ObservableSources .
 * { @ code zip } applies this function in strict sequence , so the first item emitted by the new ObservableSource
 * will be the result of the function applied to the first item emitted by each of the source ObservableSources ;
 * the second item emitted by the new ObservableSource will be the result of the function applied to the second
 * item emitted by each of those ObservableSources ; and so forth .
 * The resulting { @ code ObservableSource < R > } returned from { @ code zip } will invoke { @ code onNext } as many times as
 * the number of { @ code onNext } invocations of the source ObservableSource that emits the fewest items .
 * The operator subscribes to its sources in order they are specified and completes eagerly if
 * one of the sources is shorter than the rest while disposing the other sources . Therefore , it
 * is possible those other sources will never be able to run to completion ( and thus not calling
 * { @ code doOnComplete ( ) } ) . This can also happen if the sources are exactly the same length ; if
 * source A completes and B has been consumed and is about to complete , the operator detects A won ' t
 * be sending further values and it will dispose B immediately . For example :
 * < pre > < code > zip ( new ObservableSource [ ] { range ( 1 , 5 ) . doOnComplete ( action1 ) , range ( 6 , 5 ) . doOnComplete ( action2 ) } , ( a ) - & gt ;
 * a ) < / code > < / pre >
 * { @ code action1 } will be called but { @ code action2 } won ' t .
 * < br > To work around this termination property ,
 * use { @ link # doOnDispose ( Action ) } as well or use { @ code using ( ) } to do cleanup in case of completion
 * or a dispose ( ) call .
 * Note on method signature : since Java doesn ' t allow creating a generic array with { @ code new T [ ] } , the
 * implementation of this operator has to create an { @ code Object [ ] } instead . Unfortunately , a
 * { @ code Function < Integer [ ] , R > } passed to the method would trigger a { @ code ClassCastException } .
 * < img width = " 640 " height = " 380 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / zipArray . o . png " alt = " " >
 * < dl >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code zipArray } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param < T > the common element type
 * @ param < R > the result type
 * @ param sources
 * an array of source ObservableSources
 * @ param zipper
 * a function that , when applied to an item emitted by each of the source ObservableSources , results in
 * an item that will be emitted by the resulting ObservableSource
 * @ param delayError
 * delay errors signalled by any of the source ObservableSource until all ObservableSources terminate
 * @ param bufferSize
 * the number of elements to prefetch from each source ObservableSource
 * @ return an Observable that emits the zipped results
 * @ see < a href = " http : / / reactivex . io / documentation / operators / zip . html " > ReactiveX operators documentation : Zip < / a > */
@ CheckReturnValue @ SchedulerSupport ( SchedulerSupport . NONE ) public static < T , R > Observable < R > zipArray ( Function < ? super Object [ ] , ? extends R > zipper , boolean delayError , int bufferSize , ObservableSource < ? extends T > ... sources ) { } }

implementation: if ( sources . length == 0 ) { return empty ( ) ; } ObjectHelper . requireNonNull ( zipper , "zipper is null" ) ; ObjectHelper . verifyPositive ( bufferSize , "bufferSize" ) ; return RxJavaPlugins . onAssembly ( new ObservableZip < T , R > ( sources , null , zipper , bufferSize , delayError ) ) ;


signature:
public class Observable { /** * Returns a Single that emits a Boolean that indicates whether all of the items emitted by the source
 * ObservableSource satisfy a condition .
 * < img width = " 640 " height = " 264 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / all . o . png " alt = " " >
 * < dl >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code all } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param predicate
 * a function that evaluates an item and returns a Boolean
 * @ return a Single that emits { @ code true } if all items emitted by the source ObservableSource satisfy the
 * predicate ; otherwise , { @ code false }
 * @ see < a href = " http : / / reactivex . io / documentation / operators / all . html " > ReactiveX operators documentation : All < / a > */
@ CheckReturnValue @ SchedulerSupport ( SchedulerSupport . NONE ) public final Single < Boolean > all ( Predicate < ? super T > predicate ) { } }

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


signature:
public class Observable { /** * Mirrors the ObservableSource ( current or provided ) that first either emits an item or sends a termination
 * notification .
 * < img width = " 640 " height = " 385 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / ambWith . o . png " alt = " " >
 * < dl >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code ambWith } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param other
 * an ObservableSource competing to react first . A subscription to this provided source will occur after
 * subscribing to the current source .
 * @ return an Observable that emits the same sequence as whichever of the source ObservableSources first
 * emitted an item or sent a termination notification
 * @ see < a href = " http : / / reactivex . io / documentation / operators / amb . html " > ReactiveX operators documentation : Amb < / a > */
@ SuppressWarnings ( "unchecked" ) @ CheckReturnValue @ SchedulerSupport ( SchedulerSupport . NONE ) public final Observable < T > ambWith ( ObservableSource < ? extends T > other ) { } }

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


signature:
public class Observable { /** * Returns a Single that emits { @ code true } if any item emitted by the source ObservableSource satisfies a
 * specified condition , otherwise { @ code false } . < em > Note : < / em > this always emits { @ code false } if the
 * source ObservableSource is empty .
 * < img width = " 640 " height = " 320 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / any . 2 . png " alt = " " >
 * In Rx . Net this is the { @ code any } Observer but we renamed it in RxJava to better match Java naming
 * idioms .
 * < dl >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code any } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param predicate
 * the condition to test items emitted by the source ObservableSource
 * @ return a Single that emits a Boolean that indicates whether any item emitted by the source
 * ObservableSource satisfies the { @ code predicate }
 * @ see < a href = " http : / / reactivex . io / documentation / operators / contains . html " > ReactiveX operators documentation : Contains < / a > */
@ CheckReturnValue @ SchedulerSupport ( SchedulerSupport . NONE ) public final Single < Boolean > any ( Predicate < ? super T > predicate ) { } }

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


signature:
public class Observable { /** * Returns the first item emitted by this { @ code Observable } , or throws
 * { @ code NoSuchElementException } if it emits no items .
 * < img width = " 640 " height = " 412 " src = " https : / / github . com / ReactiveX / RxJava / wiki / images / rx - operators / blockingFirst . o . png " alt = " " >
 * < dl >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code blockingFirst } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ return the first item emitted by this { @ code Observable }
 * @ throws NoSuchElementException
 * if this { @ code Observable } emits no items
 * @ see < a href = " http : / / reactivex . io / documentation / operators / first . html " > ReactiveX documentation : First < / a > */
@ CheckReturnValue @ SchedulerSupport ( SchedulerSupport . NONE ) public final T blockingFirst ( ) { } }

implementation: BlockingFirstObserver < T > observer = new BlockingFirstObserver < T > ( ) ; subscribe ( observer ) ; T v = observer . blockingGet ( ) ; if ( v != null ) { return v ; } throw new NoSuchElementException ( ) ;


signature:
public class Observable { /** * Consumes the upstream { @ code Observable } in a blocking fashion and invokes the given
 * { @ code Consumer } with each upstream item on the < em > current thread < / em > until the
 * upstream terminates .
 * < img width = " 640 " height = " 330 " src = " https : / / github . com / ReactiveX / RxJava / wiki / images / rx - operators / blockingForEach . o . png " alt = " " >
 * < em > Note : < / em > the method will only return if the upstream terminates or the current
 * thread is interrupted .
 * This method executes the { @ code Consumer } on the current thread while
 * { @ link # subscribe ( Consumer ) } executes the consumer on the original caller thread of the
 * sequence .
 * < dl >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code blockingForEach } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < dt > < b > Error handling : < / b > < / dt >
 * < dd > If the source signals an error , the operator wraps a checked { @ link Exception }
 * into { @ link RuntimeException } and throws that . Otherwise , { @ code RuntimeException } s and
 * { @ link Error } s are rethrown as they are . < / dd >
 * < / dl >
 * @ param onNext
 * the { @ link Consumer } to invoke for each item emitted by the { @ code Observable }
 * @ throws RuntimeException
 * if an error occurs
 * @ see < a href = " http : / / reactivex . io / documentation / operators / subscribe . html " > ReactiveX documentation : Subscribe < / a >
 * @ see # subscribe ( Consumer ) */
@ SchedulerSupport ( SchedulerSupport . NONE ) public final void blockingForEach ( Consumer < ? super T > onNext ) { } }

implementation: Iterator < T > it = blockingIterable ( ) . iterator ( ) ; while ( it . hasNext ( ) ) { try { onNext . accept ( it . next ( ) ) ; } catch ( Throwable e ) { Exceptions . throwIfFatal ( e ) ; ( ( Disposable ) it ) . dispose ( ) ; throw ExceptionHelper . wrapOrThrow ( e ) ; } }


signature:
public class Observable { /** * Converts this { @ code Observable } into an { @ link Iterable } .
 * < img width = " 640 " height = " 315 " src = " https : / / github . com / ReactiveX / RxJava / wiki / images / rx - operators / blockingIterable . o . png " alt = " " >
 * < dl >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code blockingIterable } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param bufferSize the number of items to prefetch from the current Observable
 * @ return an { @ link Iterable } version of this { @ code Observable }
 * @ see < a href = " http : / / reactivex . io / documentation / operators / to . html " > ReactiveX documentation : To < / a > */
@ CheckReturnValue @ SchedulerSupport ( SchedulerSupport . NONE ) public final Iterable < T > blockingIterable ( int bufferSize ) { } }

implementation: ObjectHelper . verifyPositive ( bufferSize , "bufferSize" ) ; return new BlockingObservableIterable < T > ( this , bufferSize ) ;


signature:
public class Observable { /** * Returns the last item emitted by this { @ code Observable } , or throws
 * { @ code NoSuchElementException } if this { @ code Observable } emits no items .
 * < img width = " 640 " height = " 315 " src = " https : / / github . com / ReactiveX / RxJava / wiki / images / rx - operators / blockingLast . o . png " alt = " " >
 * < dl >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code blockingLast } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < dt > < b > Error handling : < / b > < / dt >
 * < dd > If the source signals an error , the operator wraps a checked { @ link Exception }
 * into { @ link RuntimeException } and throws that . Otherwise , { @ code RuntimeException } s and
 * { @ link Error } s are rethrown as they are . < / dd >
 * < / dl >
 * @ return the last item emitted by this { @ code Observable }
 * @ throws NoSuchElementException
 * if this { @ code Observable } emits no items
 * @ see < a href = " http : / / reactivex . io / documentation / operators / last . html " > ReactiveX documentation : Last < / a > */
@ CheckReturnValue @ SchedulerSupport ( SchedulerSupport . NONE ) public final T blockingLast ( ) { } }

implementation: BlockingLastObserver < T > observer = new BlockingLastObserver < T > ( ) ; subscribe ( observer ) ; T v = observer . blockingGet ( ) ; if ( v != null ) { return v ; } throw new NoSuchElementException ( ) ;


signature:
public class Observable { /** * Returns an { @ link Iterable } that always returns the item most recently emitted by this
 * { @ code Observable } .
 * < img width = " 640 " height = " 426 " src = " https : / / github . com / ReactiveX / RxJava / wiki / images / rx - operators / blockingMostRecent . o . png " alt = " " >
 * < dl >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code blockingMostRecent } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < / dl >
 * @ param initialValue
 * the initial value that the { @ link Iterable } sequence will yield if this
 * { @ code Observable } has not yet emitted an item
 * @ return an { @ link Iterable } that on each iteration returns the item that this { @ code Observable }
 * has most recently emitted
 * @ see < a href = " http : / / reactivex . io / documentation / operators / first . html " > ReactiveX documentation : First < / a > */
@ CheckReturnValue @ SchedulerSupport ( SchedulerSupport . NONE ) public final Iterable < T > blockingMostRecent ( T initialValue ) { } }

implementation: return new BlockingObservableMostRecent < T > ( this , initialValue ) ;


signature:
public class Observable { /** * If this { @ code Observable } completes after emitting a single item , return that item , otherwise
 * throw a { @ code NoSuchElementException } .
 * < img width = " 640 " height = " 315 " src = " https : / / github . com / ReactiveX / RxJava / wiki / images / rx - operators / blockingSingle . o . png " alt = " " >
 * < dl >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code blockingSingle } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < dt > < b > Error handling : < / b > < / dt >
 * < dd > If the source signals an error , the operator wraps a checked { @ link Exception }
 * into { @ link RuntimeException } and throws that . Otherwise , { @ code RuntimeException } s and
 * { @ link Error } s are rethrown as they are . < / dd >
 * < / dl >
 * @ return the single item emitted by this { @ code Observable }
 * @ see < a href = " http : / / reactivex . io / documentation / operators / first . html " > ReactiveX documentation : First < / a > */
@ CheckReturnValue @ SchedulerSupport ( SchedulerSupport . NONE ) public final T blockingSingle ( ) { } }

implementation: T v = singleElement ( ) . blockingGet ( ) ; if ( v == null ) { throw new NoSuchElementException ( ) ; } return v ;


signature:
public class Observable { /** * If this { @ code Observable } completes after emitting a single item , return that item ; if it emits
 * more than one item , throw an { @ code IllegalArgumentException } ; if it emits no items , return a default
 * value .
 * < img width = " 640 " height = " 315 " src = " https : / / github . com / ReactiveX / RxJava / wiki / images / rx - operators / blockingSingleDefault . o . png " alt = " " >
 * < dl >
 * < dt > < b > Scheduler : < / b > < / dt >
 * < dd > { @ code blockingSingle } does not operate by default on a particular { @ link Scheduler } . < / dd >
 * < dt > < b > Error handling : < / b > < / dt >
 * < dd > If the source signals an error , the operator wraps a checked { @ link Exception }
 * into { @ link RuntimeException } and throws that . Otherwise , { @ code RuntimeException } s and
 * { @ link Error } s are rethrown as they are . < / dd >
 * < / dl >
 * @ param defaultItem
 * a default value to return if this { @ code Observable } emits no items
 * @ return the single item emitted by this { @ code Observable } , or the default value if it emits no
 * items
 * @ see < a href = " http : / / reactivex . io / documentation / operators / first . html " > ReactiveX documentation : First < / a > */
@ CheckReturnValue @ SchedulerSupport ( SchedulerSupport . NONE ) public final T blockingSingle ( T defaultItem ) { } }

implementation: return single ( defaultItem ) . blockingGet ( ) ;