public final class Statement
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static <T> rx.Observable<T> |
doWhile(rx.Observable<? extends T> source,
rx.functions.Func0<java.lang.Boolean> postCondition)
Return an Observable that replays the emissions from the source
Observable, and then continues to replay them so long as a condtion is
true.
|
static <R> rx.Observable<R> |
ifThen(rx.functions.Func0<java.lang.Boolean> condition,
rx.Observable<? extends R> then)
Return an Observable that emits the emissions from a specified Observable
if a condition evaluates to true, otherwise return an empty Observable.
|
static <R> rx.Observable<R> |
ifThen(rx.functions.Func0<java.lang.Boolean> condition,
rx.Observable<? extends R> then,
rx.Observable<? extends R> orElse)
Return an Observable that emits the emissions from one specified
Observable if a condition evaluates to true, or from another specified
Observable otherwise.
|
static <R> rx.Observable<R> |
ifThen(rx.functions.Func0<java.lang.Boolean> condition,
rx.Observable<? extends R> then,
rx.Scheduler scheduler)
Return an Observable that emits the emissions from a specified Observable
if a condition evaluates to true, otherwise return an empty Observable
that runs on a specified Scheduler.
|
static <K,R> rx.Observable<R> |
switchCase(rx.functions.Func0<? extends K> caseSelector,
java.util.Map<? super K,? extends rx.Observable<? extends R>> mapOfCases)
Return a particular one of several possible Observables based on a case
selector.
|
static <K,R> rx.Observable<R> |
switchCase(rx.functions.Func0<? extends K> caseSelector,
java.util.Map<? super K,? extends rx.Observable<? extends R>> mapOfCases,
rx.Observable<? extends R> defaultCase)
Return a particular one of several possible Observables based on a case
selector, or a default Observable if the case selector does not map to
a particular one.
|
static <K,R> rx.Observable<R> |
switchCase(rx.functions.Func0<? extends K> caseSelector,
java.util.Map<? super K,? extends rx.Observable<? extends R>> mapOfCases,
rx.Scheduler scheduler)
Return a particular one of several possible Observables based on a case
selector and run it on the designated scheduler.
|
static <T> rx.Observable<T> |
whileDo(rx.Observable<? extends T> source,
rx.functions.Func0<java.lang.Boolean> preCondition)
Return an Observable that replays the emissions from the source
Observable so long as a condtion is true.
|
public static <K,R> rx.Observable<R> switchCase(rx.functions.Func0<? extends K> caseSelector,
java.util.Map<? super K,? extends rx.Observable<? extends R>> mapOfCases)

K - the case key typeR - the result value typecaseSelector - the function that produces a case key when an
Observer subscribesmapOfCases - a map that maps a case key to an Observablepublic static <K,R> rx.Observable<R> switchCase(rx.functions.Func0<? extends K> caseSelector,
java.util.Map<? super K,? extends rx.Observable<? extends R>> mapOfCases,
rx.Scheduler scheduler)

K - the case key typeR - the result value typecaseSelector - the function that produces a case key when an
Observer subscribesmapOfCases - a map that maps a case key to an Observablescheduler - the scheduler where the empty observable is observedpublic static <K,R> rx.Observable<R> switchCase(rx.functions.Func0<? extends K> caseSelector,
java.util.Map<? super K,? extends rx.Observable<? extends R>> mapOfCases,
rx.Observable<? extends R> defaultCase)

K - the case key typeR - the result value typecaseSelector - the function that produces a case key when an
Observer subscribesmapOfCases - a map that maps a case key to an ObservabledefaultCase - the default Observable if the mapOfCases doesn't contain a value for the key returned by the caseSelectorpublic static <T> rx.Observable<T> doWhile(rx.Observable<? extends T> source,
rx.functions.Func0<java.lang.Boolean> postCondition)

postCondition - the post condition to test after the source
Observable completespublic static <T> rx.Observable<T> whileDo(rx.Observable<? extends T> source,
rx.functions.Func0<java.lang.Boolean> preCondition)

preCondition - the condition to evaluate before subscribing to or
replaying the source ObservablepreCondition is truepublic static <R> rx.Observable<R> ifThen(rx.functions.Func0<java.lang.Boolean> condition,
rx.Observable<? extends R> then)

R - the result value typecondition - the condition that decides whether to emit the emissions
from the then Observablethen - the Observable sequence to emit to if condition is truethen Observable if the condition function evaluates to true, or an empty
Observable otherwisepublic static <R> rx.Observable<R> ifThen(rx.functions.Func0<java.lang.Boolean> condition,
rx.Observable<? extends R> then,
rx.Scheduler scheduler)

R - the result value typecondition - the condition that decides whether to emit the emissions
from the then Observablethen - the Observable sequence to emit to if condition is truescheduler - the Scheduler on which the empty Observable runs if the
in case the condition returns falsethen Observable if the condition function evaluates to true, or an empty
Observable running on the specified Scheduler otherwisepublic static <R> rx.Observable<R> ifThen(rx.functions.Func0<java.lang.Boolean> condition,
rx.Observable<? extends R> then,
rx.Observable<? extends R> orElse)

R - the result value typecondition - the condition that decides which Observable to emit the
emissions fromthen - the Observable sequence to emit to if condition is trueorElse - the Observable sequence to emit to if condition is falsethen or orElse Observables depending on a condition function