/** * Copyright 2014 Netflix, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software distributed under the License is * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See * the License for the specific language governing permissions and limitations under the License. */ package rx; import static rx.functions.Functions.alwaysFalse; import java.util.*; import java.util.concurrent.*; import rx.exceptions.*; import rx.functions.*; import rx.internal.operators.*; import rx.internal.util.ScalarSynchronousObservable; import rx.observables.*; import rx.observers.SafeSubscriber; import rx.plugins.*; import rx.schedulers.*; import rx.subjects.*; import rx.subscriptions.Subscriptions; /** * The Observable class that implements the Reactive Pattern. *
* This class provides methods for subscribing to the Observable as well as delegate methods to the various * Observers. *
* The documentation for this class makes use of marble diagrams. The following legend explains these diagrams: *
*
*
* For more information see the RxJava wiki
*
* @param
* Note: Use {@link #create(OnSubscribe)} to create an Observable, instead of this constructor,
* unless you specifically have a need for inheritance.
*
* @param f
* {@link OnSubscribe} to be executed when {@link #subscribe(Subscriber)} is called
*/
protected Observable(OnSubscribe
*
* Write the function you pass to {@code create} so that it behaves as an Observable: It should invoke the
* Subscriber's {@link Subscriber#onNext onNext}, {@link Subscriber#onError onError}, and
* {@link Subscriber#onCompleted onCompleted} methods appropriately.
*
* A well-formed Observable must invoke either the Subscriber's {@code onCompleted} method exactly once or
* its {@code onError} method exactly once.
*
* See Rx Design Guidelines (PDF) for detailed
* information.
*
* In other words, this allows chaining Observers together on an Observable for acting on the values within
* the Observable.
* {@code
* observable.map(...).filter(...).take(5).lift(new OperatorA()).lift(new OperatorB(...)).subscribe()
* }
*
* If the operator you are creating is designed to act on the individual items emitted by a source
* Observable, use {@code lift}. If your operator is designed to transform the source Observable as a whole
* (for instance, by applying a particular set of existing RxJava operators to it) use {@link #compose}.
*
* This method operates on the Observable itself whereas {@link #lift} operates on the Observable's
* Subscribers or Observers.
*
* If the operator you are creating is designed to act on the individual items emitted by a source
* Observable, use {@link #lift}. If your operator is designed to transform the source Observable as a whole
* (for instance, by applying a particular set of existing RxJava operators to it) use {@code compose}.
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
* The defer Observer allows you to defer or delay emitting items from an Observable until such time as an
* Observer subscribes to the Observable. This allows an {@link Observer} to easily obtain updates or a
* refreshed version of the sequence.
*
*
*
*
* You can convert any object that supports the {@link Future} interface into an Observable that emits the
* return value of the {@link Future#get} method of that object, by passing the object into the {@code from}
* method.
*
* Important note: This Observable is blocking; you cannot unsubscribe from it.
*
*
* You can convert any object that supports the {@link Future} interface into an Observable that emits the
* return value of the {@link Future#get} method of that object, by passing the object into the {@code from}
* method.
*
* Important note: This Observable is blocking; you cannot unsubscribe from it.
*
*
* You can convert any object that supports the {@link Future} interface into an Observable that emits the
* return value of the {@link Future#get} method of that object, by passing the object into the {@code from}
* method.
*
*
*
*
*
*
* To convert any object into an Observable that emits that object, pass that object into the {@code just}
* method.
*
* This is similar to the {@link #from(java.lang.Object[])} method, except that {@code from} will convert
* an {@link Iterable} object into an Observable that emits each of the items in the Iterable, one at a
* time, while the {@code just} method converts an Iterable into an Observable that emits the entire
* Iterable as a single item.
*
*
*
*
*
*
*
*
*
*
*
* You can combine the items emitted by multiple Observables so that they appear as a single Observable, by
* using the {@code merge} method.
*
*
* You can combine the items emitted by multiple Observables so that they appear as a single Observable, by
* using the {@code merge} method.
*
*
* You can combine the items emitted by multiple Observables so that they appear as a single Observable, by
* using the {@code merge} method.
*
*
* You can combine the items emitted by multiple Observables so that they appear as a single Observable, by
* using the {@code merge} method.
*
*
* You can combine items emitted by multiple Observables so that they appear as a single Observable, by
* using the {@code merge} method.
*
*
* You can combine items emitted by multiple Observables so that they appear as a single Observable, by
* using the {@code merge} method.
*
*
* You can combine items emitted by multiple Observables so that they appear as a single Observable, by
* using the {@code merge} method.
*
*
* You can combine items emitted by multiple Observables so that they appear as a single Observable, by
* using the {@code merge} method.
*
*
* You can combine items emitted by multiple Observables so that they appear as a single Observable, by
* using the {@code merge} method.
*
*
* You can combine items emitted by multiple Observables so that they appear as a single Observable, by
* using the {@code merge} method.
*
*
* You can combine items emitted by multiple Observables so that they appear as a single Observable, by
* using the {@code merge} method.
*
*
* You can combine items emitted by multiple Observables so that they appear as a single Observable, by
* using the {@code merge} method.
*
*
* You can combine items emitted by multiple Observables so that they appear as a single Observable, by
* using the {@code merge} method.
*
* This behaves like {@link #merge(Observable)} except that if any of the merged Observables notify of an
* error via {@link Observer#onError onError}, {@code mergeDelayError} will refrain from propagating that
* error notification until all of the merged Observables have finished emitting items.
*
*
* Even if multiple merged Observables send {@code onError} notifications, {@code mergeDelayError} will only
* invoke the {@code onError} method of its Observers once.
*
* This behaves like {@link #merge(Observable, Observable)} except that if any of the merged Observables
* notify of an error via {@link Observer#onError onError}, {@code mergeDelayError} will refrain from
* propagating that error notification until all of the merged Observables have finished emitting items.
*
*
* Even if both merged Observables send {@code onError} notifications, {@code mergeDelayError} will only
* invoke the {@code onError} method of its Observers once.
*
* This behaves like {@link #merge(Observable, Observable, Observable)} except that if any of the merged
* Observables notify of an error via {@link Observer#onError onError}, {@code mergeDelayError} will refrain
* from propagating that error notification until all of the merged Observables have finished emitting
* items.
*
*
* Even if multiple merged Observables send {@code onError} notifications, {@code mergeDelayError} will only
* invoke the {@code onError} method of its Observers once.
*
* This behaves like {@link #merge(Observable, Observable, Observable, Observable)} except that if any of
* the merged Observables notify of an error via {@link Observer#onError onError}, {@code mergeDelayError}
* will refrain from propagating that error notification until all of the merged Observables have finished
* emitting items.
*
*
* Even if multiple merged Observables send {@code onError} notifications, {@code mergeDelayError} will only
* invoke the {@code onError} method of its Observers once.
*
* This behaves like {@link #merge(Observable, Observable, Observable, Observable, Observable)} except that
* if any of the merged Observables notify of an error via {@link Observer#onError onError},
* {@code mergeDelayError} will refrain from propagating that error notification until all of the merged
* Observables have finished emitting items.
*
*
* Even if multiple merged Observables send {@code onError} notifications, {@code mergeDelayError} will only
* invoke the {@code onError} method of its Observers once.
*
* This behaves like {@link #merge(Observable, Observable, Observable, Observable, Observable, Observable)}
* except that if any of the merged Observables notify of an error via {@link Observer#onError onError},
* {@code mergeDelayError} will refrain from propagating that error notification until all of the merged
* Observables have finished emitting items.
*
*
* Even if multiple merged Observables send {@code onError} notifications, {@code mergeDelayError} will only
* invoke the {@code onError} method of its Observers once.
*
* This behaves like
* {@link #merge(Observable, Observable, Observable, Observable, Observable, Observable, Observable)}
* except that if any of the merged Observables notify of an error via {@link Observer#onError onError},
* {@code mergeDelayError} will refrain from propagating that error notification until all of the merged
* Observables have finished emitting items.
*
*
* Even if multiple merged Observables send {@code onError} notifications, {@code mergeDelayError} will only
* invoke the {@code onError} method of its Observers once.
*
* This behaves like {@link #merge(Observable, Observable, Observable, Observable, Observable, Observable, Observable, Observable)}
* except that if any of the merged Observables notify of an error via {@link Observer#onError onError},
* {@code mergeDelayError} will refrain from propagating that error notification until all of the merged
* Observables have finished emitting items.
*
*
* Even if multiple merged Observables send {@code onError} notifications, {@code mergeDelayError} will only
* invoke the {@code onError} method of its Observers once.
*
* This behaves like {@link #merge(Observable, Observable, Observable, Observable, Observable, Observable, Observable, Observable, Observable)}
* except that if any of the merged Observables notify of an error via {@link Observer#onError onError},
* {@code mergeDelayError} will refrain from propagating that error notification until all of the merged
* Observables have finished emitting items.
*
*
* Even if multiple merged Observables send {@code onError} notifications, {@code mergeDelayError} will only
* invoke the {@code onError} method of its Observers once.
*
*
*
* This Observable is useful primarily for testing purposes.
*
*
*
*
*
*
* {@code switchOnNext} subscribes to an Observable that emits Observables. Each time it observes one of
* these emitted Observables, the Observable returned by {@code switchOnNext} begins emitting the items
* emitted by that Observable. When a new Observable is emitted, {@code switchOnNext} stops emitting items
* from the earlier-emitted Observable and begins emitting items from the new one.
*
*
*
*
*
*
* {@code zip} applies this function in strict sequence, so the first item emitted by the new Observable
* will be the result of the function applied to the first item emitted by each of the source Observables;
* the second item emitted by the new Observable will be the result of the function applied to the second
* item emitted by each of those Observables; and so forth.
*
* The resulting {@code Observable
*
* {@code zip} applies this function in strict sequence, so the first item emitted by the new Observable
* will be the result of the function applied to the first item emitted by each of the Observables emitted
* by the source Observable; the second item emitted by the new Observable will be the result of the
* function applied to the second item emitted by each of those Observables; and so forth.
*
* The resulting {@code Observable
*
*
* {@code zip} applies this function in strict sequence, so the first item emitted by the new Observable
* will be the result of the function applied to the first item emitted by {@code o1} and the first item
* emitted by {@code o2}; the second item emitted by the new Observable will be the result of the function
* applied to the second item emitted by {@code o1} and the second item emitted by {@code o2}; and so forth.
*
* The resulting {@code Observable
*
* {@code zip} applies this function in strict sequence, so the first item emitted by the new Observable
* will be the result of the function applied to the first item emitted by {@code o1}, the first item
* emitted by {@code o2}, and the first item emitted by {@code o3}; the second item emitted by the new
* Observable will be the result of the function applied to the second item emitted by {@code o1}, the
* second item emitted by {@code o2}, and the second item emitted by {@code o3}; and so forth.
*
* The resulting {@code Observable
*
* {@code zip} applies this function in strict sequence, so the first item emitted by the new Observable
* will be the result of the function applied to the first item emitted by {@code o1}, the first item
* emitted by {@code o2}, the first item emitted by {@code o3}, and the first item emitted by {@code 04};
* the second item emitted by the new Observable will be the result of the function applied to the second
* item emitted by each of those Observables; and so forth.
*
* The resulting {@code Observable
*
* {@code zip} applies this function in strict sequence, so the first item emitted by the new Observable
* will be the result of the function applied to the first item emitted by {@code o1}, the first item
* emitted by {@code o2}, the first item emitted by {@code o3}, the first item emitted by {@code o4}, and
* the first item emitted by {@code o5}; the second item emitted by the new Observable will be the result of
* the function applied to the second item emitted by each of those Observables; and so forth.
*
* The resulting {@code Observable
*
* {@code zip} applies this function in strict sequence, so the first item emitted by the new Observable
* will be the result of the function applied to the first item emitted by each source Observable, the
* second item emitted by the new Observable will be the result of the function applied to the second item
* emitted by each of those Observables, and so forth.
*
* The resulting {@code Observable
*
*
*
* @param
*
*
* @param lift the Operator that implements the Observable-operating function to be applied to the source
* Observable
* @return an Observable that is the result of applying the lifted Operator to the source Observable
* @see RxJava wiki: Implementing Your Own Operators
*/
public final
*
*
* @param transformer implements the function that transforms the source Observable
* @return the source Observable, transformed by the transformer function
* @see RxJava wiki: Implementing Your Own Operators
*/
@SuppressWarnings("unchecked")
public
*
*
*
* @param sources
* an Iterable of Observable sources competing to react first
* @return an Observable that emits the same sequence of items as whichever of the source Observables first
* emitted an item
* @see RxJava wiki: amb
* @see MSDN: Observable.Amb
*/
public final static
*
*
*
* @param o1
* an Observable competing to react first
* @param o2
* an Observable competing to react first
* @return an Observable that emits the same sequence of items as whichever of the source Observables first
* emitted an item
* @see RxJava wiki: amb
* @see MSDN: Observable.Amb
*/
public final static
*
*
*
* @param o1
* an Observable competing to react first
* @param o2
* an Observable competing to react first
* @param o3
* an Observable competing to react first
* @return an Observable that emits the same sequence of items as whichever of the source Observables first
* emitted an item
* @see RxJava wiki: amb
* @see MSDN: Observable.Amb
*/
public final static
*
*
*
* @param o1
* an Observable competing to react first
* @param o2
* an Observable competing to react first
* @param o3
* an Observable competing to react first
* @param o4
* an Observable competing to react first
* @return an Observable that emits the same sequence of items as whichever of the source Observables first
* emitted an item
* @see RxJava wiki: amb
* @see MSDN: Observable.Amb
*/
public final static
*
*
*
* @param o1
* an Observable competing to react first
* @param o2
* an Observable competing to react first
* @param o3
* an Observable competing to react first
* @param o4
* an Observable competing to react first
* @param o5
* an Observable competing to react first
* @return an Observable that emits the same sequence of items as whichever of the source Observables first
* emitted an item
* @see RxJava wiki: amb
* @see MSDN: Observable.Amb
*/
public final static
*
*
*
* @param o1
* an Observable competing to react first
* @param o2
* an Observable competing to react first
* @param o3
* an Observable competing to react first
* @param o4
* an Observable competing to react first
* @param o5
* an Observable competing to react first
* @param o6
* an Observable competing to react first
* @return an Observable that emits the same sequence of items as whichever of the source Observables first
* emitted an item
* @see RxJava wiki: amb
* @see MSDN: Observable.Amb
*/
public final static
*
*
*
* @param o1
* an Observable competing to react first
* @param o2
* an Observable competing to react first
* @param o3
* an Observable competing to react first
* @param o4
* an Observable competing to react first
* @param o5
* an Observable competing to react first
* @param o6
* an Observable competing to react first
* @param o7
* an Observable competing to react first
* @return an Observable that emits the same sequence of items as whichever of the source Observables first
* emitted an item
* @see RxJava wiki: amb
* @see MSDN: Observable.Amb
*/
public final static
*
*
*
* @param o1
* an Observable competing to react first
* @param o2
* an Observable competing to react first
* @param o3
* an Observable competing to react first
* @param o4
* an Observable competing to react first
* @param o5
* an Observable competing to react first
* @param o6
* an Observable competing to react first
* @param o7
* an Observable competing to react first
* @param o8
* an observable competing to react first
* @return an Observable that emits the same sequence of items as whichever of the source Observables first
* emitted an item
* @see RxJava wiki: amb
* @see MSDN: Observable.Amb
*/
public final static
*
*
*
* @param o1
* an Observable competing to react first
* @param o2
* an Observable competing to react first
* @param o3
* an Observable competing to react first
* @param o4
* an Observable competing to react first
* @param o5
* an Observable competing to react first
* @param o6
* an Observable competing to react first
* @param o7
* an Observable competing to react first
* @param o8
* an Observable competing to react first
* @param o9
* an Observable competing to react first
* @return an Observable that emits the same sequence of items as whichever of the source Observables first
* emitted an item
* @see RxJava wiki: amb
* @see MSDN: Observable.Amb
*/
public final static
*
*
*
* @param o1
* the first source Observable
* @param o2
* the second source Observable
* @param combineFunction
* the aggregation function used to combine the items emitted by the source Observables
* @return an Observable that emits items that are the result of combining the items emitted by the source
* Observables by means of the given aggregation function
* @see RxJava wiki: combineLatest
* @see MSDN: Observable.CombineLatest
*/
@SuppressWarnings("unchecked")
public static final
*
*
*
* @param o1
* the first source Observable
* @param o2
* the second source Observable
* @param o3
* the third source Observable
* @param combineFunction
* the aggregation function used to combine the items emitted by the source Observables
* @return an Observable that emits items that are the result of combining the items emitted by the source
* Observables by means of the given aggregation function
* @see RxJava wiki: combineLatest
* @see MSDN: Observable.CombineLatest
*/
@SuppressWarnings("unchecked")
public static final
*
*
*
* @param o1
* the first source Observable
* @param o2
* the second source Observable
* @param o3
* the third source Observable
* @param o4
* the fourth source Observable
* @param combineFunction
* the aggregation function used to combine the items emitted by the source Observables
* @return an Observable that emits items that are the result of combining the items emitted by the source
* Observables by means of the given aggregation function
* @see RxJava wiki: combineLatest
* @see MSDN: Observable.CombineLatest
*/
@SuppressWarnings("unchecked")
public static final
*
*
*
* @param o1
* the first source Observable
* @param o2
* the second source Observable
* @param o3
* the third source Observable
* @param o4
* the fourth source Observable
* @param o5
* the fifth source Observable
* @param combineFunction
* the aggregation function used to combine the items emitted by the source Observables
* @return an Observable that emits items that are the result of combining the items emitted by the source
* Observables by means of the given aggregation function
* @see RxJava wiki: combineLatest
* @see MSDN: Observable.CombineLatest
*/
@SuppressWarnings("unchecked")
public static final
*
*
*
* @param o1
* the first source Observable
* @param o2
* the second source Observable
* @param o3
* the third source Observable
* @param o4
* the fourth source Observable
* @param o5
* the fifth source Observable
* @param o6
* the sixth source Observable
* @param combineFunction
* the aggregation function used to combine the items emitted by the source Observables
* @return an Observable that emits items that are the result of combining the items emitted by the source
* Observables by means of the given aggregation function
* @see RxJava wiki: combineLatest
* @see MSDN: Observable.CombineLatest
*/
@SuppressWarnings("unchecked")
public static final
*
*
*
* @param o1
* the first source Observable
* @param o2
* the second source Observable
* @param o3
* the third source Observable
* @param o4
* the fourth source Observable
* @param o5
* the fifth source Observable
* @param o6
* the sixth source Observable
* @param o7
* the seventh source Observable
* @param combineFunction
* the aggregation function used to combine the items emitted by the source Observables
* @return an Observable that emits items that are the result of combining the items emitted by the source
* Observables by means of the given aggregation function
* @see RxJava wiki: combineLatest
* @see MSDN: Observable.CombineLatest
*/
@SuppressWarnings("unchecked")
public static final
*
*
*
* @param o1
* the first source Observable
* @param o2
* the second source Observable
* @param o3
* the third source Observable
* @param o4
* the fourth source Observable
* @param o5
* the fifth source Observable
* @param o6
* the sixth source Observable
* @param o7
* the seventh source Observable
* @param o8
* the eighth source Observable
* @param combineFunction
* the aggregation function used to combine the items emitted by the source Observables
* @return an Observable that emits items that are the result of combining the items emitted by the source
* Observables by means of the given aggregation function
* @see RxJava wiki: combineLatest
* @see MSDN: Observable.CombineLatest
*/
@SuppressWarnings("unchecked")
public static final
*
*
*
* @param o1
* the first source Observable
* @param o2
* the second source Observable
* @param o3
* the third source Observable
* @param o4
* the fourth source Observable
* @param o5
* the fifth source Observable
* @param o6
* the sixth source Observable
* @param o7
* the seventh source Observable
* @param o8
* the eighth source Observable
* @param o9
* the ninth source Observable
* @param combineFunction
* the aggregation function used to combine the items emitted by the source Observables
* @return an Observable that emits items that are the result of combining the items emitted by the source
* Observables by means of the given aggregation function
* @see RxJava wiki: combineLatest
* @see MSDN: Observable.CombineLatest
*/
@SuppressWarnings("unchecked")
public static final
*
*
* @param
*
*
*
* @param observables
* an Observable that emits Observables
* @return an Observable that emits items all of the items emitted by the Observables emitted by
* {@code observables}, one after the other, without interleaving them
* @see RxJava wiki: concat
* @see MSDN: Observable.Concat
*/
public final static
*
*
*
* @param t1
* an Observable to be concatenated
* @param t2
* an Observable to be concatenated
* @return an Observable that emits items emitted by the two source Observables, one after the other,
* without interleaving them
* @see RxJava wiki: concat
* @see MSDN: Observable.Concat
*/
public final static
*
*
*
* @param t1
* an Observable to be concatenated
* @param t2
* an Observable to be concatenated
* @param t3
* an Observable to be concatenated
* @return an Observable that emits items emitted by the three source Observables, one after the other,
* without interleaving them
* @see RxJava wiki: concat
* @see MSDN: Observable.Concat
*/
public final static
*
*
*
* @param t1
* an Observable to be concatenated
* @param t2
* an Observable to be concatenated
* @param t3
* an Observable to be concatenated
* @param t4
* an Observable to be concatenated
* @return an Observable that emits items emitted by the four source Observables, one after the other,
* without interleaving them
* @see RxJava wiki: concat
* @see MSDN: Observable.Concat
*/
public final static
*
*
*
* @param t1
* an Observable to be concatenated
* @param t2
* an Observable to be concatenated
* @param t3
* an Observable to be concatenated
* @param t4
* an Observable to be concatenated
* @param t5
* an Observable to be concatenated
* @return an Observable that emits items emitted by the five source Observables, one after the other,
* without interleaving them
* @see RxJava wiki: concat
* @see MSDN: Observable.Concat
*/
public final static
*
*
*
* @param t1
* an Observable to be concatenated
* @param t2
* an Observable to be concatenated
* @param t3
* an Observable to be concatenated
* @param t4
* an Observable to be concatenated
* @param t5
* an Observable to be concatenated
* @param t6
* an Observable to be concatenated
* @return an Observable that emits items emitted by the six source Observables, one after the other,
* without interleaving them
* @see RxJava wiki: concat
* @see MSDN: Observable.Concat
*/
public final static
*
*
*
* @param t1
* an Observable to be concatenated
* @param t2
* an Observable to be concatenated
* @param t3
* an Observable to be concatenated
* @param t4
* an Observable to be concatenated
* @param t5
* an Observable to be concatenated
* @param t6
* an Observable to be concatenated
* @param t7
* an Observable to be concatenated
* @return an Observable that emits items emitted by the seven source Observables, one after the other,
* without interleaving them
* @see RxJava wiki: concat
* @see MSDN: Observable.Concat
*/
public final static
*
*
*
* @param t1
* an Observable to be concatenated
* @param t2
* an Observable to be concatenated
* @param t3
* an Observable to be concatenated
* @param t4
* an Observable to be concatenated
* @param t5
* an Observable to be concatenated
* @param t6
* an Observable to be concatenated
* @param t7
* an Observable to be concatenated
* @param t8
* an Observable to be concatenated
* @return an Observable that emits items emitted by the eight source Observables, one after the other,
* without interleaving them
* @see RxJava wiki: concat
* @see MSDN: Observable.Concat
*/
public final static
*
*
*
* @param t1
* an Observable to be concatenated
* @param t2
* an Observable to be concatenated
* @param t3
* an Observable to be concatenated
* @param t4
* an Observable to be concatenated
* @param t5
* an Observable to be concatenated
* @param t6
* an Observable to be concatenated
* @param t7
* an Observable to be concatenated
* @param t8
* an Observable to be concatenated
* @param t9
* an Observable to be concatenated
* @return an Observable that emits items emitted by the nine source Observables, one after the other,
* without interleaving them
* @see RxJava wiki: concat
* @see MSDN: Observable.Concat
*/
public final static
*
*
*
* @param observableFactory
* the Observable factory function to invoke for each {@link Observer} that subscribes to the
* resulting Observable
* @param
*
*
*
* @param
*
*
*
* @param exception
* the particular Throwable to pass to {@link Observer#onError onError}
* @param
*
*
*
* @param future
* the source {@link Future}
* @param
*
*
*
* @param future
* the source {@link Future}
* @param timeout
* the maximum time to wait before calling {@code get}
* @param unit
* the {@link TimeUnit} of the {@code timeout} argument
* @param
*
*
*
* @param future
* the source {@link Future}
* @param scheduler
* the {@link Scheduler} to wait for the Future on. Use a Scheduler such as
* {@link Schedulers#io()} that can block and wait on the Future
* @param
*
*
*
* @param iterable
* the source {@link Iterable} sequence
* @param
*
*
*
* @param array
* the source Array
* @param
*
*
*
* @param interval
* interval 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 RxJava wiki: interval
* @see MSDN: Observable.Interval
*/
public final static Observable
*
*
*
* @param interval
* interval 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 RxJava wiki: interval
* @see MSDN: Observable.Interval
*/
public final static Observable
*
*
*
* @param value
* the item to emit
* @param
*
*
*
* @param t1
* first item
* @param t2
* second item
* @param
*
*
*
* @param t1
* first item
* @param t2
* second item
* @param t3
* third item
* @param
*
*
*
* @param t1
* first item
* @param t2
* second item
* @param t3
* third item
* @param t4
* fourth item
* @param
*
*
*
* @param t1
* first item
* @param t2
* second item
* @param t3
* third item
* @param t4
* fourth item
* @param t5
* fifth item
* @param
*
*
*
* @param t1
* first item
* @param t2
* second item
* @param t3
* third item
* @param t4
* fourth item
* @param t5
* fifth item
* @param t6
* sixth item
* @param
*
*
*
* @param t1
* first item
* @param t2
* second item
* @param t3
* third item
* @param t4
* fourth item
* @param t5
* fifth item
* @param t6
* sixth item
* @param t7
* seventh item
* @param
*
*
*
* @param t1
* first item
* @param t2
* second item
* @param t3
* third item
* @param t4
* fourth item
* @param t5
* fifth item
* @param t6
* sixth item
* @param t7
* seventh item
* @param t8
* eighth item
* @param
*
*
*
* @param t1
* first item
* @param t2
* second item
* @param t3
* third item
* @param t4
* fourth item
* @param t5
* fifth item
* @param t6
* sixth item
* @param t7
* seventh item
* @param t8
* eighth item
* @param t9
* ninth item
* @param
*
*
*
* @param t1
* first item
* @param t2
* second item
* @param t3
* third item
* @param t4
* fourth item
* @param t5
* fifth item
* @param t6
* sixth item
* @param t7
* seventh item
* @param t8
* eighth item
* @param t9
* ninth item
* @param t10
* tenth item
* @param
*
*
*
* @param sequences
* the Iterable of Observables
* @return an Observable that emits items that are the result of flattening the items emitted by the
* Observables in the Iterable
* @see RxJava wiki: merge
* @see MSDN: Observable.Merge
*/
public final static
*
*
*
* @param sequences
* the Iterable of Observables
* @param maxConcurrent
* the maximum number of Observables that may be subscribed to concurrently
* @return an Observable that emits items that are the result of flattening the items emitted by the
* Observables in the Iterable
* @throws IllegalArgumentException
* if {@code maxConcurrent} is less than or equal to 0
* @see RxJava wiki: merge
* @see MSDN: Observable.Merge
*/
public final static
*
*
*
* @param source
* an Observable that emits Observables
* @return an Observable that emits items that are the result of flattening the Observables emitted by the
* {@code source} Observable
* @see RxJava wiki: merge
* @see MSDN: Observable.Merge
*/
public final static
*
*
*
* @param source
* an Observable that emits Observables
* @param maxConcurrent
* the maximum number of Observables that may be subscribed to concurrently
* @return an Observable that emits items that are the result of flattening the Observables emitted by the
* {@code source} Observable
* @throws IllegalArgumentException
* if {@code maxConcurrent} is less than or equal to 0
* @see RxJava wiki: merge
* @see MSDN: Observable.Merge
*/
public final static
*
*
*
* @param t1
* an Observable to be merged
* @param t2
* an Observable to be merged
* @return an Observable that emits all of the items emitted by the source Observables
* @see RxJava wiki: merge
* @see MSDN: Observable.Merge
*/
@SuppressWarnings("unchecked")
public final static
*
*
*
* @param t1
* an Observable to be merged
* @param t2
* an Observable to be merged
* @param t3
* an Observable to be merged
* @return an Observable that emits all of the items emitted by the source Observables
* @see RxJava wiki: merge
* @see MSDN: Observable.Merge
*/
@SuppressWarnings("unchecked")
public final static
*
*
*
* @param t1
* an Observable to be merged
* @param t2
* an Observable to be merged
* @param t3
* an Observable to be merged
* @param t4
* an Observable to be merged
* @return an Observable that emits all of the items emitted by the source Observables
* @see RxJava wiki: merge
* @see MSDN: Observable.Merge
*/
@SuppressWarnings("unchecked")
public final static
*
*
*
* @param t1
* an Observable to be merged
* @param t2
* an Observable to be merged
* @param t3
* an Observable to be merged
* @param t4
* an Observable to be merged
* @param t5
* an Observable to be merged
* @return an Observable that emits all of the items emitted by the source Observables
* @see RxJava wiki: merge
* @see MSDN: Observable.Merge
*/
@SuppressWarnings("unchecked")
public final static
*
*
*
* @param t1
* an Observable to be merged
* @param t2
* an Observable to be merged
* @param t3
* an Observable to be merged
* @param t4
* an Observable to be merged
* @param t5
* an Observable to be merged
* @param t6
* an Observable to be merged
* @return an Observable that emits all of the items emitted by the source Observables
* @see RxJava wiki: merge
* @see MSDN: Observable.Merge
*/
@SuppressWarnings("unchecked")
public final static
*
*
*
* @param t1
* an Observable to be merged
* @param t2
* an Observable to be merged
* @param t3
* an Observable to be merged
* @param t4
* an Observable to be merged
* @param t5
* an Observable to be merged
* @param t6
* an Observable to be merged
* @param t7
* an Observable to be merged
* @return an Observable that emits all of the items emitted by the source Observables
* @see RxJava wiki: merge
* @see MSDN: Observable.Merge
*/
@SuppressWarnings("unchecked")
public final static
*
*
*
* @param t1
* an Observable to be merged
* @param t2
* an Observable to be merged
* @param t3
* an Observable to be merged
* @param t4
* an Observable to be merged
* @param t5
* an Observable to be merged
* @param t6
* an Observable to be merged
* @param t7
* an Observable to be merged
* @param t8
* an Observable to be merged
* @return an Observable that emits all of the items emitted by the source Observables
* @see RxJava wiki: merge
* @see MSDN: Observable.Merge
*/
@SuppressWarnings("unchecked")
public final static
*
*
*
* @param t1
* an Observable to be merged
* @param t2
* an Observable to be merged
* @param t3
* an Observable to be merged
* @param t4
* an Observable to be merged
* @param t5
* an Observable to be merged
* @param t6
* an Observable to be merged
* @param t7
* an Observable to be merged
* @param t8
* an Observable to be merged
* @param t9
* an Observable to be merged
* @return an Observable that emits all of the items emitted by the source Observables
* @see RxJava wiki: merge
* @see MSDN: Observable.Merge
*/
@SuppressWarnings("unchecked")
public final static
*
*
*
* @param sequences
* the Array of Observables
* @return an Observable that emits all of the items emitted by the Observables in the Array
* @see RxJava wiki: merge
* @see MSDN: Observable.Merge
*/
public final static
*
*
*
* @param source
* an Observable that emits Observables
* @return an Observable that emits all of the items emitted by the Observables emitted by the
* {@code source} Observable
* @see RxJava wiki: mergeDelayError
* @see MSDN: Observable.Merge
*/
public final static
*
*
*
* @param t1
* an Observable to be merged
* @param t2
* an Observable to be merged
* @return an Observable that emits all of the items that are emitted by the two source Observables
* @see RxJava wiki: mergeDelayError
* @see MSDN: Observable.Merge
*/
public final static
*
*
*
* @param t1
* an Observable to be merged
* @param t2
* an Observable to be merged
* @param t3
* an Observable to be merged
* @return an Observable that emits all of the items that are emitted by the source Observables
* @see RxJava wiki: mergeDelayError
* @see MSDN: Observable.Merge
*/
public final static
*
*
*
* @param t1
* an Observable to be merged
* @param t2
* an Observable to be merged
* @param t3
* an Observable to be merged
* @param t4
* an Observable to be merged
* @return an Observable that emits all of the items that are emitted by the source Observables
* @see RxJava wiki: mergeDelayError
* @see MSDN: Observable.Merge
*/
public final static
*
*
*
* @param t1
* an Observable to be merged
* @param t2
* an Observable to be merged
* @param t3
* an Observable to be merged
* @param t4
* an Observable to be merged
* @param t5
* an Observable to be merged
* @return an Observable that emits all of the items that are emitted by the source Observables
* @see RxJava wiki: mergeDelayError
* @see MSDN: Observable.Merge
*/
public final static
*
*
*
* @param t1
* an Observable to be merged
* @param t2
* an Observable to be merged
* @param t3
* an Observable to be merged
* @param t4
* an Observable to be merged
* @param t5
* an Observable to be merged
* @param t6
* an Observable to be merged
* @return an Observable that emits all of the items that are emitted by the source Observables
* @see RxJava wiki: mergeDelayError
* @see MSDN: Observable.Merge
*/
public final static
*
*
*
* @param t1
* an Observable to be merged
* @param t2
* an Observable to be merged
* @param t3
* an Observable to be merged
* @param t4
* an Observable to be merged
* @param t5
* an Observable to be merged
* @param t6
* an Observable to be merged
* @param t7
* an Observable to be merged
* @return an Observable that emits all of the items that are emitted by the source Observables
* @see RxJava wiki: mergeDelayError
* @see MSDN: Observable.Merge
*/
public final static
*
*
*
* @param t1
* an Observable to be merged
* @param t2
* an Observable to be merged
* @param t3
* an Observable to be merged
* @param t4
* an Observable to be merged
* @param t5
* an Observable to be merged
* @param t6
* an Observable to be merged
* @param t7
* an Observable to be merged
* @param t8
* an Observable to be merged
* @return an Observable that emits all of the items that are emitted by the source Observables
* @see RxJava wiki: mergeDelayError
* @see MSDN: Observable.Merge
*/
// suppress because the types are checked by the method signature before using a vararg
public final static
*
*
*
* @param t1
* an Observable to be merged
* @param t2
* an Observable to be merged
* @param t3
* an Observable to be merged
* @param t4
* an Observable to be merged
* @param t5
* an Observable to be merged
* @param t6
* an Observable to be merged
* @param t7
* an Observable to be merged
* @param t8
* an Observable to be merged
* @param t9
* an Observable to be merged
* @return an Observable that emits all of the items that are emitted by the source Observables
* @see RxJava wiki: mergeDelayError
* @see MSDN: Observable.Merge
*/
public final static
*
*
*
* @return an Observable that emits a single item: the source Observable
*/
public final Observable
*
*
*
* @param
*
*
*
* @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} − 1 exceeds
* {@code Integer.MAX_VALUE}
* @see RxJava wiki: range
* @see MSDN: Observable.Range
*/
public final static Observable
*
*
*
* @param start
* the value of the first Integer in the sequence
* @param count
* the number of sequential Integers to generate
* @param scheduler
* the Scheduler to run the generator loop on
* @return an Observable that emits a range of sequential Integers
* @see RxJava wiki: range
* @see MSDN: Observable.Range
*/
public final static Observable
*
*
*
* @param first
* the first Observable to compare
* @param second
* the second Observable to compare
* @param
*
*
*
* @param first
* the first Observable to compare
* @param second
* the second Observable to compare
* @param equality
* a function used to compare items emitted by each Observable
* @param
*
*
*
* @param
*
*
*
* @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}
* @return an Observable that emits a 0L after the {@code initialDelay} and ever increasing numbers after
* each {@code period} of time thereafter
* @see RxJava wiki: timer
* @see MSDN: Observable.Timer
*/
public final static Observable
*
*
*
* @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 RxJava wiki: timer
* @see MSDN: Observable.Timer
*/
public final static Observable
*
*
*
* @param delay
* the initial delay before emitting a single {@code 0L}
* @param unit
* time units to use for {@code delay}
* @return an Observable that emits one item after a specified delay, and then completes
* @see RxJava wiki: timer
* @see MSDN: Observable.Timer
*/
public final static Observable
*
*
*
* @param delay
* the initial delay before emitting a single 0L
* @param unit
* time units to use for {@code delay}
* @param scheduler
* the {@link Scheduler} to use for scheduling the item
* @return an Observable that emits one item after a specified delay, on a specified Scheduler, and then
* completes
* @see RxJava wiki: timer
* @see MSDN: Observable.Timer
*/
public final static Observable
*
*
*
* @param resourceFactory
* the factory function to create a resource object that depends on the Observable
* @param observableFactory
* the factory function to create an Observable
* @param disposeAction
* the function that will dispose of the resource
* @return the Observable whose lifetime controls the lifetime of the dependent resource object
* @see RxJava wiki: using
* @see MSDN: Observable.Using
*/
public final static
*
*
*
* @param ws
* an Iterable of source Observables
* @param zipFunction
* a function that, when applied to an item emitted by each of the source Observables, results in
* an item that will be emitted by the resulting Observable
* @return an Observable that emits the zipped results
* @see RxJava wiki: zip
* @see MSDN: Observable.Zip
*/
public final static
*
*
*
* @param ws
* an Observable of source Observables
* @param zipFunction
* a function that, when applied to an item emitted by each of the Observables emitted by
* {@code ws}, results in an item that will be emitted by the resulting Observable
* @return an Observable that emits the zipped results
* @see RxJava wiki: zip
* @see MSDN: Observable.Zip
*/
public final static >, Observable>[]>() {
@Override
public Observable>[] call(List extends Observable>> o) {
return o.toArray(new Observable>[o.size()]);
}
}).lift(new OperatorZip
*
*
*
* @param o1
* the first source Observable
* @param o2
* a second source Observable
* @param zipFunction
* a function that, when applied to an item emitted by each of the source Observables, results
* in an item that will be emitted by the resulting Observable
* @return an Observable that emits the zipped results
* @see RxJava wiki: zip
* @see MSDN: Observable.Zip
*/
public final static
*
*
*
* @param o1
* the first source Observable
* @param o2
* a second source Observable
* @param o3
* a third source Observable
* @param zipFunction
* a function that, when applied to an item emitted by each of the source Observables, results in
* an item that will be emitted by the resulting Observable
* @return an Observable that emits the zipped results
* @see RxJava wiki: zip
* @see MSDN: Observable.Zip
*/
public final static
*
*
*
* @param o1
* the first source Observable
* @param o2
* a second source Observable
* @param o3
* a third source Observable
* @param o4
* a fourth source Observable
* @param zipFunction
* a function that, when applied to an item emitted by each of the source Observables, results in
* an item that will be emitted by the resulting Observable
* @return an Observable that emits the zipped results
* @see RxJava wiki: zip
* @see MSDN: Observable.Zip
*/
public final static
*
*
*
* @param o1
* the first source Observable
* @param o2
* a second source Observable
* @param o3
* a third source Observable
* @param o4
* a fourth source Observable
* @param o5
* a fifth source Observable
* @param zipFunction
* a function that, when applied to an item emitted by each of the source Observables, results in
* an item that will be emitted by the resulting Observable
* @return an Observable that emits the zipped results
* @see RxJava wiki: zip
* @see MSDN: Observable.Zip
*/
public final static
*