T - the element typepublic final class ObservableBuilder<T> extends java.lang.Object implements Observable<T>
Observable which
lets the user chain some Reactive operators.
This builder is the dual of the
IterableBuilder class.
| Modifier and Type | Field and Description |
|---|---|
protected Observable<T> |
o
The backed observable.
|
| Modifier | Constructor and Description |
|---|---|
protected |
ObservableBuilder(Observable<T> source)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
ObservableBuilder<TimeInterval<T>> |
addTimeInterval()
Returns an observable which provides a TimeInterval of Ts which
records the elapsed time between successive elements.
|
ObservableBuilder<Timestamped<T>> |
addTimestamped()
Wrap the values within a observable to a timestamped value having always
the System.currentTimeMillis() value.
|
ObservableBuilder<T> |
aggregate(Func2<? super T,? super T,? extends T> accumulator)
Apply an accumulator function over the observable source and submit the accumulated value to the returned observable.
|
<U,V> ObservableBuilder<V> |
aggregate(Func2<? super U,? super T,? extends U> sum,
Func2<? super U,? super java.lang.Integer,? extends V> divide)
Computes an aggregated value of the source Ts by applying a sum function and applying the divide function when the source
finishes, sending the result to the output.
|
<U> ObservableBuilder<U> |
aggregate(U seed,
Func2<? super U,? super T,? extends U> accumulator)
Apply an accumulator function over the observable source and submit the accumulated value to the returned observable.
|
<U,V> ObservableBuilder<V> |
aggregate(U seed,
Func2<? super U,? super T,? extends U> accumulator,
Func1<? super U,? extends V> resultSelector)
Aggregates the sequence via the accumulator function
and transforms the result value with the selector.
|
<U,V> ObservableBuilder<V> |
aggregate(U seed,
Func2<? super U,? super T,? extends U> accumulator,
Func2<? super U,? super java.lang.Integer,? extends V> divider)
Computes an aggregated value of the source Ts by
using the initial seed, applying an
accumulator function and applying the divide function when the source
finishes, sending the result to the output.
|
ObservableBuilder<java.lang.Boolean> |
all(Func1<? super T,java.lang.Boolean> predicate)
Signals a single true or false if all elements of the observable matches the predicate.
|
ObservableBuilder<T> |
amb(java.lang.Iterable<? extends Observable<? extends T>> others)
Channels the values of the first observable who fires first from the given set of observables.
|
ObservableBuilder<T> |
amb(Observable<? extends T> other)
Channels the values from the first observable (this or other) who fires firts.
|
ObservableBuilder<java.lang.Boolean> |
any()
Signals a single true if the source observable contains any element.
|
ObservableBuilder<java.lang.Boolean> |
any(Func1<? super T,java.lang.Boolean> predicate)
Signals a single TRUE if the source signals any next() and the value matches the predicate before it signals a finish().
|
ObservableBuilder<java.math.BigDecimal> |
averageBigDecimal()
Computes and signals the average value of the BigDecimal source.
|
ObservableBuilder<java.math.BigDecimal> |
averageBigInteger()
Computes and signals the average value of the BigInteger source.
|
ObservableBuilder<java.lang.Double> |
averageDouble()
Computes and signals the average value of the Double source.
|
ObservableBuilder<java.lang.Float> |
averageFloat()
Computes and signals the average value of the Float source.
|
ObservableBuilder<java.lang.Double> |
averageInt()
Computes and signals the average value of the integer source.
|
ObservableBuilder<java.lang.Double> |
averageLong()
Computes and signals the average value of the Long source.
|
T |
await()
Waits indefinitely for the observable to complete and returns the last
value.
|
T |
await(long time,
java.util.concurrent.TimeUnit unit)
Waits a limited amount of time for the observable to complete and returns the last
value.
|
<U> ObservableBuilder<java.util.List<T>> |
buffer(Func0<Observable<U>> windowClosingSelector)
Buffer parts of the source until the window observable finishes.
|
ObservableBuilder<java.util.List<T>> |
buffer(int bufferSize)
Buffer the nodes as they become available and send them out in bufferSize chunks.
|
ObservableBuilder<java.util.List<T>> |
buffer(int bufferSize,
int skip)
Buffer the nodes as they become available and send them out in bufferSize chunks.
|
ObservableBuilder<java.util.List<T>> |
buffer(int bufferSize,
long time,
java.util.concurrent.TimeUnit unit)
Buffer the Ts of the source until the buffer reaches its capacity or the current time unit runs out.
|
ObservableBuilder<java.util.List<T>> |
buffer(int bufferSize,
long time,
java.util.concurrent.TimeUnit unit,
Scheduler pool)
Buffer the Ts of the source until the buffer reaches its capacity or the current time unit runs out.
|
ObservableBuilder<java.util.List<T>> |
buffer(long time,
java.util.concurrent.TimeUnit unit)
Buffers the source observable Ts into a list of Ts periodically and submits them to the returned observable.
|
ObservableBuilder<java.util.List<T>> |
buffer(long time,
java.util.concurrent.TimeUnit unit,
Scheduler pool)
Buffers the source observable Ts into a list of Ts periodically and submits them to the returned observable.
|
<U,V> ObservableBuilder<java.util.List<T>> |
buffer(Observable<? extends U> windowOpening,
Func1<? super U,? extends Observable<V>> windowClosing)
Projects the incoming values into multiple buffers based on
when a window-open fires an event and a window-close finishes.
|
<U> ObservableBuilder<java.util.List<T>> |
buffer(Observable<U> boundary)
Buffers the source elements into non-overlapping lists separated
by notification values from the boundary observable and its finish event.
|
<U> ObservableBuilder<U> |
cast()
Casts the values of this observable implicitly
and forwards a ClassCastException if it occurs.
|
<U> ObservableBuilder<U> |
cast(java.lang.Class<U> token)
Casts the values of this observable via the given type token
or forwards a ClassCastException.
|
java.lang.Iterable<java.util.List<T>> |
chunkify()
Produces an iterable sequence of consequtive (possibly empty)
chunks of the source sequence.
|
<U> java.lang.Iterable<U> |
collect(Func0<? extends U> newCollector,
Func2<? super U,? super T,? extends U> merge)
Produces an enumerable sequence that returns elements
collected/aggregated/whatever from the source
between consequtive iterations.
|
<U> CloseableIterable<U> |
collect(Func0<? extends U> initialCollector,
Func2<? super U,? super T,? extends U> merge,
Func1<? super U,? extends U> newCollector)
Produces an iterable sequence that returns elements
collected/aggregated/whatever from the source
sequence between consequtive iteration.
|
ObservableBuilder<java.util.List<T>> |
combineFirst(java.util.List<? extends Observable<? extends T>> srcs)
Combine the incoming Ts of the various observables into a single list of Ts like
using Reactive.zip() on more than two sources.
|
<U,V> ObservableBuilder<V> |
combineLatest(Observable<? extends U> right,
Func2<? super T,? super U,? extends V> selector)
Returns an observable which combines the latest values of
both streams whenever one sends a new value, but only after both sent a value.
|
<U,V> ObservableBuilder<V> |
combineLatest0(Observable<? extends U> right,
Func2<? super T,? super U,? extends V> selector)
Returns an observable which combines the latest values of
both streams whenever one sends a new value.
|
ObservableBuilder<T> |
concat(java.lang.Iterable<? extends Observable<? extends T>> sources)
Concatenates the source observables in a way that when the first finish(), the
second gets registered and continued, and so on.
|
ObservableBuilder<T> |
concat(Observable<? extends T> second)
Concatenate two observables in a way when the first finish() the second is registered
and continued with.
|
ObservableBuilder<T> |
concatAll(Observable<? extends Observable<? extends T>> sources)
Concatenate the the multiple sources of T one after another.
|
java.io.Closeable |
connect()
Connect this observable if the underlying observable supports
the ConnectableObservable interface, or throw an UnsupportedOperationException.
|
ObservableBuilder<java.lang.Boolean> |
contains(Func0<? extends T> supplier)
Signals a single TRUE if the source observable signals a value equals()
with the supplied value.
|
ObservableBuilder<java.lang.Boolean> |
contains(T value)
Signals a single TRUE if the source observable signals a value equals() with the source value.
|
ObservableBuilder<java.lang.Integer> |
count()
Counts the number of elements in the observable source.
|
ObservableBuilder<java.lang.Integer> |
count(Func1<? super T,java.lang.Boolean> predicate)
Counts the number of elements where the predicate returns true.
|
ObservableBuilder<java.lang.Long> |
countLong()
Counts the number of elements in the observable source as a long.
|
ObservableBuilder<java.lang.Integer> |
countLong(Func1<? super T,java.lang.Boolean> predicate)
Counts the number of elements where the predicate returns true as long.
|
ObservableBuilder<T> |
debugState()
Constructs an observer which logs errors in case next(), finish() or error() is called
and the observer is not in running state anymore due an earlier finish() or error() call.
|
ObservableBuilder<T> |
defaultIfEmpty(Func0<? extends T> defaultValueFunc)
Returns the default value provided by
the function if the source sequence is empty.
|
ObservableBuilder<T> |
defaultIfEmpty(T defaultValue)
Returns the default value if the source
sequence is empty.
|
static <T> ObservableBuilder<T> |
defer(Func0<? extends Observable<? extends T>> observableFactory)
The returned observable invokes the
observableFactory whenever an observer
tries to subscribe to it. |
<U> ObservableBuilder<T> |
delay(Func1<? super T,? extends Observable<U>> delaySelector)
Delays (ties) the event delivery of the source,
for each source value T, to the firing of the observable returned
by the delay selector.
|
ObservableBuilder<T> |
delay(long time,
java.util.concurrent.TimeUnit unit)
Delays the propagation of events of the source by the given amount.
|
ObservableBuilder<T> |
delay(long time,
java.util.concurrent.TimeUnit unit,
Scheduler pool)
Delays the propagation of events of the source by the given amount.
|
<U,V> ObservableBuilder<T> |
delay(Observable<U> registerDelay,
Func1<? super T,? extends Observable<V>> delaySelector)
Delays (ties) the event delivery of the source
to the firing of registerDelay (optionally) and
for each source value T, to the firing of the observable returned
by the delay selector.
|
ObservableBuilder<T> |
delayRegister(long time,
java.util.concurrent.TimeUnit unit)
Delays the registration to the underlying observable by
a given amount.
|
ObservableBuilder<T> |
delayRegister(long time,
java.util.concurrent.TimeUnit unit,
Scheduler pool)
Delays the registration to the underlying observable by
a given amount.
|
ObservableBuilder<T> |
dematerialize()
Returns an observable which converts all option messages
back to regular next(), error() and finish() messages.
|
ObservableBuilder<T> |
distinct()
Returns the distinct elements from the source.
|
<U> ObservableBuilder<T> |
distinct(Func1<? super T,? extends U> keyExtractor,
Func2<? super U,? super U,java.lang.Boolean> keyComparer)
Returns a sequence of elements who are distinct
in terms of the given key extracted by a function
and compared against each other via the comparer function.
|
<U> ObservableBuilder<T> |
distinct(Func1<T,U> keyExtractor)
Returns a sequence of elements distinct in
terms of the key extracted from them.
|
ObservableBuilder<T> |
distinct(Func2<? super T,? super T,java.lang.Boolean> comparer)
Returns the distinct elements from the source according
to the given comparator function.
|
ObservableBuilder<T> |
doWhile(Func0<java.lang.Boolean> condition)
Repeats the given source so long as the condition returns true.
|
ObservableBuilder<java.lang.Void> |
drain(Func1<? super T,? extends Observable<java.lang.Void>> pump)
Maintains a queue of Ts which is then drained by the pump.
|
ObservableBuilder<java.lang.Void> |
drain(Func1<? super T,? extends Observable<java.lang.Void>> pump,
Scheduler pool)
Maintains a queue of Ts which is then drained by the pump.
|
ObservableBuilder<T> |
elementAt(int index)
Returns a single element from the sequence at the index or throws
a NoSuchElementException if the sequence terminates before this index.
|
ObservableBuilder<T> |
elementAt(int index,
Func0<? extends T> defaultSupplier)
Returns a single element from the sequence at the index or the
default value supplied if the sequence terminates before this index.
|
ObservableBuilder<T> |
elementAt(int index,
T defaultValue)
Returns a single element from the sequence at the index or the
default value if the sequence terminates before this index.
|
ObservableBuilder<T> |
empty()
Returns an empty observable, which fires only finish().
|
ObservableBuilder<T> |
empty(Scheduler pool)
Returns an empty observable which signals only finish() on the given pool.
|
ObservableBuilder<T> |
finish(Action0 action)
Invokes the given action when the source signals a finish() or error().
|
T |
first()
Blocks until the first element of the observable becomes available
and returns that element.
|
T |
first(Func0<? extends T> defaultSupplier)
Blocks until the first element of the observable becomes available
and returns that element or returns the supplier's value if the observable is empty.
|
T |
first(T defaultValue)
Blocks until the first element of the observable becomes available
and returns that element or returns the default value if the observable is empty.
|
ObservableBuilder<T> |
firstAsync()
Returns an observable which takes the first value from the source observable
as a single element or throws NoSuchElementException if the source is empty.
|
ObservableBuilder<T> |
firstAsync(Func0<? extends T> defaultSupplier)
Returns an observable which takes the first value from the source observable
as a single element or the supplier's value if the source is empty.
|
ObservableBuilder<T> |
firstAsync(T defaultValue)
Returns an observable which takes the first value from the source observable
as a single element or the default value if the source is empty.
|
void |
forEach(Action1<? super T> action)
Invokes the action on each element in the source,
and blocks until the source terminates either way.
|
boolean |
forEach(Action1<? super T> action,
long time,
java.util.concurrent.TimeUnit unit)
Invokes the action on each element in the source,
and blocks until the source terminates or the time runs out.
|
void |
forEach(Action2<? super T,? super java.lang.Integer> action)
Invokes the indexed action on each element in the source,
and blocks until the source terminates either way.
|
boolean |
forEach(Action2<? super T,? super java.lang.Integer> action,
long time,
java.util.concurrent.TimeUnit unit)
Invokes the indexed action on each element in the source,
and blocks until the source terminates either way.
|
ObservableBuilder<java.util.List<T>> |
forkJoin(java.lang.Iterable<? extends Observable<? extends T>> sources)
Runs the observables in parallel and joins their last values whenever one fires.
|
static ObservableBuilder<java.lang.Void> |
from(Action0 action)
Invokes the action asynchronously on the given pool and
relays its finish() or error() messages.
|
static ObservableBuilder<java.lang.Void> |
from(Action0 action,
Scheduler pool)
Invokes the action asynchronously on the given pool and
relays its finish() or error() messages.
|
static <T> ObservableBuilder<T> |
from(java.util.concurrent.Callable<? extends T> call)
Invoke the given callable on the default pool and observe its result via the returned observable.
|
static <T> ObservableBuilder<T> |
from(java.util.concurrent.Callable<? extends T> call,
Scheduler pool)
Invoke the given callable on the given pool and observe its result via the returned observable.
|
static <T> ObservableBuilder<T> |
from(Func0<? extends T> func)
Invokes the function asynchronously on the default pool and
relays its result followed by a finish.
|
static <T> ObservableBuilder<T> |
from(Func0<? extends T> func,
Scheduler pool)
Invokes the function asynchronously on the given pool and
relays its result followed by a finish.
|
static <T> ObservableBuilder<T> |
from(java.lang.Iterable<? extends T> source)
Creates an observable builder from the source sequence by using
the default scheduler to emit the values.
|
static <T> ObservableBuilder<T> |
from(java.lang.Iterable<? extends T> source,
Scheduler scheduler)
Creates an observable builder from the source sequence and uses
the given schduler to emit the values.
|
static <T> ObservableBuilder<T> |
from(Observable<T> source)
Wraps the supplied observable sequence into an observable builder
or returns it if the source is also an ObservableBuilder.
|
static <T> ObservableBuilder<T> |
from(java.lang.Runnable run)
Invoke the given callable on the given pool and observe its result via the returned observable.
|
static <T> ObservableBuilder<T> |
from(java.lang.Runnable run,
Scheduler pool)
Invoke the given callable on the given pool and observe its result via the returned observable.
|
static <T> ObservableBuilder<T> |
from(java.lang.Runnable run,
T defaultValue)
Invoke the given callable on the given pool and observe its result via the returned observable.
|
static <T> ObservableBuilder<T> |
from(java.lang.Runnable run,
T defaultValue,
Scheduler pool)
Invoke the given callable on the given pool and observe its result via the returned observable.
|
static <T> ObservableBuilder<T> |
from(Scheduler scheduler,
T... ts)
Creates an observable sequence from the array of values and uses
the given scheduler to emit these values.
|
static <T> ObservableBuilder<T> |
from(T... ts)
Creates an observable sequence from the array of values and uses
the default scheduler to emit these values.
|
static <T> ObservableBuilder<T> |
fromOriginal(java.util.Observable javaObservable)
Converts the original Java Observable into an reactive-Observable builder instance.
|
static <T> ObservableBuilder<T> |
fromPart(int start,
int end,
Scheduler scheduler,
T... ts)
Creates an observable sequence from the subarray of values and uses
the given scheduler to emit these values.
|
static <T> ObservableBuilder<T> |
fromPart(int start,
int end,
T... ts)
Creates an observable sequence from the subarray of values and uses
the default scheduler to emit these values.
|
static <T,U> ObservableBuilder<U> |
generate(T initial,
Func1<? super T,java.lang.Boolean> condition,
Func1<? super T,? extends T> next,
Func1<? super T,? extends U> selector)
Generates a stream of Us by using a value T stream using the default pool fo the generator loop.
|
static <T,U> ObservableBuilder<U> |
generate(T initial,
Func1<? super T,java.lang.Boolean> condition,
Func1<? super T,? extends T> next,
Func1<? super T,? extends U> selector,
Scheduler pool)
Generates a stream of Us by using a value T stream.
|
static <T,U> ObservableBuilder<Timestamped<U>> |
generateTimed(T initial,
Func1<? super T,java.lang.Boolean> condition,
Func1<? super T,? extends T> next,
Func1<? super T,? extends U> selector,
Func1<? super T,java.lang.Long> delay)
Generates a stream of Us by using a value T stream.
|
static <T,U> ObservableBuilder<Timestamped<U>> |
generateTimed(T initial,
Func1<? super T,java.lang.Boolean> condition,
Func1<? super T,? extends T> next,
Func1<? super T,? extends U> selector,
Func1<? super T,java.lang.Long> delay,
Scheduler pool)
Generates a stream of Us by using a value T stream.
|
<Key> ObservableBuilder<GroupedObservable<Key,T>> |
groupBy(Func1<? super T,? extends Key> keyExtractor)
Group the specified source accoring to the keys provided by the extractor function.
|
<U,Key> ObservableBuilder<GroupedObservable<Key,U>> |
groupBy(Func1<? super T,? extends Key> keyExtractor,
Func1<? super T,? extends U> valueExtractor)
Group the specified source according to the keys provided by the extractor function.
|
<K,D> ObservableBuilder<GroupedObservable<K,T>> |
groupByUntil(Func1<? super T,? extends K> keySelector,
Func1<? super GroupedObservable<K,T>,? extends Observable<D>> durationSelector)
Groups the source sequence of Ts until the specified duration for that group fires.
|
<K,D> ObservableBuilder<GroupedObservable<K,T>> |
groupByUntil(Func1<? super T,? extends K> keySelector,
Func1<? super GroupedObservable<K,T>,? extends Observable<D>> durationSelector,
Func2<? super K,? super K,java.lang.Boolean> keyComparer)
Groups the source sequence of Ts until the specified duration for that group fires.
|
<K,V,D> ObservableBuilder<GroupedObservable<K,V>> |
groupByUntil(Func1<? super T,? extends K> keySelector,
Func1<? super T,? extends V> valueSelector,
Func1<? super GroupedObservable<K,V>,? extends Observable<D>> durationSelector)
Groups the source sequence of Ts until the specified duration for that group fires.
|
<K,V,D> ObservableBuilder<GroupedObservable<K,V>> |
groupByUntil(Func1<? super T,? extends K> keySelector,
Func1<? super T,? extends V> valueSelector,
Func1<? super GroupedObservable<K,V>,? extends Observable<D>> durationSelector,
Func2<? super K,? super K,java.lang.Boolean> keyComparer)
Groups the source sequence of Ts until the specified duration for that group fires.
|
<Right,LeftDuration,RightDuration,Result> |
groupJoin(Observable<? extends Right> right,
Func1<? super T,? extends Observable<LeftDuration>> leftDurationSelector,
Func1<? super Right,? extends Observable<RightDuration>> rightDurationSelector,
Func2<? super T,? super Observable<? extends Right>,? extends Result> resultSelector)
Returns an observable which correlates two streams of values based on
their time when they overlapped and groups the results.
|
ObservableBuilder<T> |
ignoreValues()
Ignores the next() messages of the source and forwards only the error() and
finish() messages.
|
<U extends java.util.Collection<? super T>> |
into(U out)
Add the elements of the sequence into the supplied collection.
|
ObservableBuilder<T> |
invoke(Action1<? super T> action)
Invoke a specific action before relaying the Ts to the observable.
|
ObservableBuilder<T> |
invoke(Action1<? super T> onNext,
Action0 onFinish)
Invokes the given actions while relaying events.
|
ObservableBuilder<T> |
invoke(Action1<? super T> onNext,
Action1<? super java.lang.Throwable> onError)
Invokes the given actions while relaying events.
|
ObservableBuilder<T> |
invoke(Action1<? super T> onNext,
Action1<? super java.lang.Throwable> onError,
Action0 onFinish)
Invokes the given actions while relaying events.
|
ObservableBuilder<T> |
invoke(Observer<? super T> observer)
Invoke a specific observer before relaying the Ts, finish() and error() to the observable.
|
ObservableBuilder<java.lang.Boolean> |
isEmpty()
Signals true if the source observable fires finish() without ever firing next().
|
boolean |
isInstance(java.lang.Class<?> clazz)
Checks if the wrapped Observable is the instance of the given class or interface
according to Class.isInstance().
|
<Right,LeftDuration,RightDuration,Result> |
join(Observable<? extends Right> right,
Func1<? super T,? extends Observable<LeftDuration>> leftDurationSelector,
Func1<? super Right,? extends Observable<RightDuration>> rightDurationSelector,
Func2<? super T,? super Right,? extends Result> resultSelector)
Returns an observable which correlates two streams of values based on
their time when they overlapped.
|
T |
last()
Returns the last element of the source observable or throws
NoSuchElementException if the source is empty or the wait is interrupted.
|
T |
last(Func0<? extends T> defaultSupplier)
Returns the last element of the source observable or the
supplier's value if the source is empty.
|
T |
last(T defaultValue)
Returns the last element of the source observable or the
default value if the source is empty.
|
ObservableBuilder<T> |
lastAsync()
Returns an observable which relays the last element of the source observable
or throws a NoSuchElementException() if the source is empty.
|
ObservableBuilder<T> |
lastAsync(Func0<? extends T> defaultSupplier)
Returns an observable which relays the last element of the source observable
or the supplier's value if the source is empty.
|
ObservableBuilder<T> |
lastAsync(T defaultValue)
Returns an observable which relays the last element of the source observable
or the default value if the source is empty.
|
IterableBuilder<T> |
latest()
Returns an iterable which returns values on a momentary basis from the
source.
|
<U> ObservableBuilder<U> |
manySelect(Func1<? super Observable<T>,? extends Observable<U>> selector)
For each of the source elements, creates a view of the source starting with the given
element and calls the selector function.
|
<U> ObservableBuilder<U> |
manySelect(Func1<? super Observable<T>,? extends U> selector,
Scheduler scheduler)
For each value of the source observable, it creates a view starting from that value into the source
and calls the given selector function asynchronously on the given scheduler.
|
<U> ObservableBuilder<U> |
manySelect0(Func1<? super Observable<T>,? extends U> selector)
Uses the selector function on the given source observable to extract a single
value and send this value to the registered observer.
|
ObservableBuilder<Option<T>> |
materialize()
Returns an observable which converts all messages to an
Option value. |
<U extends java.lang.Comparable<? super U>> |
max()
Returns the maximum value encountered in the source observable onse it finish().
|
ObservableBuilder<T> |
max(java.util.Comparator<T> comparator)
Returns the maximum value encountered in the source observable onse it finish().
|
<Key extends java.lang.Comparable<? super Key>> |
maxBy(Func1<? super T,? extends Key> keyExtractor)
Returns an observable which provides with the list of
Ts which had their keys as maximums. |
<Key> ObservableBuilder<java.util.List<T>> |
maxBy(Func1<? super T,? extends Key> keyExtractor,
java.util.Comparator<? super Key> keyComparator)
Returns an observable which provides with the list of
Ts which had their keys as maximums. |
ObservableBuilder<T> |
merge(java.lang.Iterable<? extends Observable<? extends T>> sources)
Combines the notifications of all sources.
|
ObservableBuilder<T> |
merge(Observable<? extends T> second)
Merge the events of two observable sequences.
|
ObservableBuilder<T> |
mergeAll(Observable<? extends Observable<T>> sources)
Merge the dynamic sequence of observables of T.
|
<U extends java.lang.Comparable<? super U>> |
min()
Returns the minimum value encountered in the source observable onse it finish().
|
ObservableBuilder<T> |
min(java.util.Comparator<? super T> comparator)
Returns the minimum value encountered in the source observable onse it finish().
|
<Key extends java.lang.Comparable<? super Key>> |
minBy(Func1<? super T,? extends Key> keyExtractor)
Returns an observable which provides with the list of
Ts which had their keys as minimums. |
<Key> ObservableBuilder<java.util.List<T>> |
minBy(Func1<T,Key> keyExtractor,
java.util.Comparator<Key> keyComparator)
Returns an observable which provides with the list of
Ts which had their keys as minimums. |
IterableBuilder<T> |
mostRecent(T initialValue)
Samples the latest T value coming from the source observable or the initial
value when no messages arrived so far.
|
<U,V> Observable<V> |
multicast(Func0<? extends Subject<? super T,? extends U>> subjectSelector,
Func1<? super Observable<? extends U>,? extends Observable<? extends V>> selector)
Multicasts the source events through the subject instantiated via
the subjectSelector.
|
<U> ObservableBuilder<U> |
multicast(Observer<? super T> observer,
Observable<? extends U> observable)
Returns an observable which remains connected to the
source
observable as long as there is at least one registration to this output observable. |
ObservableBuilder<T> |
never()
Returns an observable which never fires.
|
static <T> ObservableBuilder<T> |
newBuilder(Observable<T> source)
Wraps the source observable into a new observable builder instance.
|
IterableBuilder<T> |
next()
Returns an iterable sequence which blocks until an element
becomes available from the source.
|
ObservableBuilder<T> |
observeOn(Scheduler pool)
Wrap the given observable object in a way that any of its observers receive callbacks on
the given thread pool.
|
<U> ObservableBuilder<U> |
ofType(java.lang.Class<U> clazz)
Filters the elements of the source sequence which
is assignable to the provided type.
|
<U extends java.lang.Comparable<? super U>> |
orderBy()
Returns an Observable which traverses the entire
source Observable and creates an ordered list
of elements.
|
ObservableBuilder<T> |
orderBy(java.util.Comparator<? super T> comparator)
Returns an Observable which traverses the entire
source Observable and creates an ordered list
of elements.
|
<U extends java.lang.Comparable<? super U>> |
orderBy(Func1<? super T,? extends U> keySelector)
Returns an Observable which traverses the entire
source Observable and creates an ordered list
of elements.
|
<U> ObservableBuilder<T> |
orderBy(Func1<? super T,? extends U> keySelector,
java.util.Comparator<? super U> keyComparator)
Returns an Observable which traverses the entire
source Observable and creates an ordered list
of elements.
|
void |
print()
Runs this observable and prints the values.
|
void |
println()
Runs this observable and prints the values.
|
ObservableBuilder<T> |
prune()
Returns an observable which shares all registration to the source observable and
each observer will only see the last notification.
|
<U> ObservableBuilder<U> |
prune(Func1<? super Observable<? extends T>,? extends Observable<U>> selector)
Returns an observable which shares all registration to the source observable and
each observer will only see the last notification.
|
<U> ObservableBuilder<U> |
prune(Func1<? super Observable<? extends T>,? extends Observable<U>> selector,
Scheduler scheduler)
Returns an observable which shares all registration to the source observable and
each observer will only see the last notification.
|
ObservableBuilder<T> |
prune(Scheduler scheduler)
Returns an observable which shares all registration to the source observable and
each observer will only see the last notification.
|
ObservableBuilder<T> |
publish()
Returns an observable which shares a single subscription to the underlying source.
|
<U> ObservableBuilder<U> |
publish(Func1<? super Observable<? extends T>,? extends Observable<? extends U>> selector)
Returns an observable sequence which is the result of
invoking the selector on a connectable observable sequence
that shares a single subscription with the underlying
source observable. |
<U> ObservableBuilder<U> |
publish(Func1<? super Observable<? extends T>,? extends Observable<? extends U>> selector,
T initialValue)
Returns an observable sequence which is the result of
invoking the selector on a connectable observable sequence
that shares a single subscription with the underlying
source observable and registering parties
receive the initial value immediately. |
ObservableBuilder<T> |
publish(T initialValue)
Returns an observable which shares a single subscription to the underlying source
and starts with with the initial value.
|
ObservableBuilder<T> |
publishLast()
Returns a connectable observable which uses a single registration
to the underlying source sequence containing only the last value.
|
<U> ObservableBuilder<U> |
publishLast(Func1<? super Observable<? extends T>,? extends Observable<? extends U>> selector)
Retunrs an observable that is the result of the selector invocation
on a connectable observable that shares a single registration to
source and returns the last event of the source. |
static ObservableBuilder<java.math.BigDecimal> |
range(java.math.BigDecimal start,
int count,
java.math.BigDecimal step)
Creates an observable which generates numbers from start.
|
static ObservableBuilder<java.math.BigDecimal> |
range(java.math.BigDecimal start,
int count,
java.math.BigDecimal step,
Scheduler pool)
Creates an observable which generates BigDecimal numbers from start.
|
static ObservableBuilder<java.math.BigInteger> |
range(java.math.BigInteger start,
java.math.BigInteger count)
Creates an observable which generates numbers from start.
|
static ObservableBuilder<java.math.BigInteger> |
range(java.math.BigInteger start,
java.math.BigInteger count,
Scheduler pool)
Creates an observable which generates BigInteger numbers from start.
|
static ObservableBuilder<java.lang.Double> |
range(double start,
int count,
double step)
Creates an observable which generates numbers from start.
|
static ObservableBuilder<java.lang.Double> |
range(double start,
int count,
double step,
Scheduler pool)
Creates an observable which produces Double values from
start in count
amount and each subsequent element has a difference of step. |
static ObservableBuilder<java.lang.Float> |
range(float start,
int count,
float step)
Creates an observable which generates numbers from start.
|
static ObservableBuilder<java.lang.Float> |
range(float start,
int count,
float step,
Scheduler pool)
Creates an observable which produces Float values from
start in count
amount and each subsequent element has a difference of step. |
static ObservableBuilder<java.lang.Integer> |
range(int start,
int count)
Creates an observable which generates numbers from start.
|
static ObservableBuilder<java.lang.Integer> |
range(int start,
int count,
Scheduler pool)
Creates an observable which generates numbers from start.
|
static ObservableBuilder<java.lang.Long> |
range(long start,
long count)
Creates an observable which generates numbers from start.
|
static ObservableBuilder<java.lang.Long> |
range(long start,
long count,
Scheduler pool)
Creates an observable which generates numbers from start.
|
ObservableBuilder<T> |
refCount()
Returns an observable sequence which
connects to the source for the first registered
party and stays connected to the source
as long as there is at least one registered party to it.
|
java.io.Closeable |
register(java.util.Observer javaObserver)
Registers a java-observer with this reactive-observable instance.
|
java.io.Closeable |
register(Observer<? super T> observer)
Registers an observer for the notification of Ts.
|
ObservableBuilder<T> |
registerOn(Scheduler pool)
Wrap the given observable into an new Observable instance, which calls the original register() method
on the supplied pool.
|
ObservableBuilder<T> |
relayUntil(Func0<java.lang.Boolean> condition)
Relay values of T while the given condition does not hold.
|
ObservableBuilder<T> |
relayWhile(Func0<java.lang.Boolean> condition)
Relay the stream of Ts until condition turns into false.
|
ObservableBuilder<T> |
removeTimeInterval()
Unwrap the values within a timeinterval observable to its normal value.
|
ObservableBuilder<T> |
removeTimestamped()
Unwrap the values within a timestamped observable to its normal value.
|
ObservableBuilder<T> |
repeat()
Repeat the source observable indefinitely.
|
static <T> ObservableBuilder<T> |
repeat(Func0<? extends T> func)
Creates an observable which repeatedly calls the given function which generates the Ts indefinitely.
|
static <T> ObservableBuilder<T> |
repeat(Func0<? extends T> func,
int count)
Creates an observable which repeatedly calls the given function
count times to generate Ts
and runs on the default pool. |
static <T> ObservableBuilder<T> |
repeat(Func0<? extends T> func,
int count,
Scheduler pool)
Creates an observable which repeatedly calls the given function
count times to generate Ts
and runs on the given pool. |
static <T> ObservableBuilder<T> |
repeat(Func0<? extends T> func,
Scheduler pool)
Creates an observable which repeatedly calls the given function which generates the Ts indefinitely.
|
ObservableBuilder<T> |
repeat(int count)
Repeat the source observable count times.
|
static <T> ObservableBuilder<T> |
repeat(T value)
Creates an observable which repeates the given value indefinitely
and runs on the default pool.
|
static <T> ObservableBuilder<T> |
repeat(T value,
int count)
Creates an observable which repeates the given value
count times
and runs on the default pool. |
static <T> ObservableBuilder<T> |
repeat(T value,
int count,
Scheduler pool)
Creates an observable which repeates the given value
count times
and runs on the given pool. |
static <T> ObservableBuilder<T> |
repeat(T value,
Scheduler pool)
Creates an observable which repeates the given value indefinitely
and runs on the given pool.
|
ObservableBuilder<T> |
replay()
Creates an observable which shares the source observable and replays all source Ts
to any of the registering observers.
|
<U> ObservableBuilder<U> |
replay(Func1<? super Observable<? extends T>,? extends Observable<U>> selector,
int bufferSize)
Creates an observable which shares the source observable and replays the buffered source Ts
to any of the registering observers.
|
<U> ObservableBuilder<U> |
replay(Func1<? super Observable<? extends T>,? extends Observable<U>> selector,
int bufferSize,
long timeSpan,
java.util.concurrent.TimeUnit unit)
Creates an observable which shares the source observable and replays the bufferSize source Ts
to any of the registering observers.
|
<U> ObservableBuilder<U> |
replay(Func1<? super Observable<? extends T>,? extends Observable<U>> selector,
int bufferSize,
long timeSpan,
java.util.concurrent.TimeUnit unit,
Scheduler scheduler)
Creates an observable which shares the source observable and replays the bufferSize source Ts
to any of the registering observers.
|
<U> ObservableBuilder<U> |
replay(Func1<? super Observable<? extends T>,? extends Observable<U>> selector,
int bufferSize,
Scheduler scheduler)
Creates an observable which shares the source observable returned by the selector and replays all source Ts
to any of the registering observers.
|
<U> ObservableBuilder<U> |
replay(Func1<? super Observable<? extends T>,? extends Observable<U>> selector,
long timeSpan,
java.util.concurrent.TimeUnit unit)
Creates an observable which shares the source observable and replays all source Ts
to any of the registering observers.
|
<U> ObservableBuilder<U> |
replay(Func1<? super Observable<? extends T>,? extends Observable<U>> selector,
long timeSpan,
java.util.concurrent.TimeUnit unit,
Scheduler scheduler)
Creates an observable which shares the source observable and replays all source Ts
to any of the registering observers.
|
<U> ObservableBuilder<U> |
replay(Func1<? super Observable<T>,? extends Observable<U>> selector)
Returns the observable sequence for the supplied source observable by
invoking the selector function with it.
|
ObservableBuilder<T> |
replay(int bufferSize)
Creates an observable which shares the source observable and replays the buffered source Ts
to any of the registering observers.
|
ObservableBuilder<T> |
replay(int bufferSize,
long timeSpan,
java.util.concurrent.TimeUnit unit)
Creates an observable which shares the source observable and replays the bufferSize source Ts
to any of the registering observers.
|
ObservableBuilder<T> |
replay(int bufferSize,
long timeSpan,
java.util.concurrent.TimeUnit unit,
Scheduler scheduler)
Creates an observable which shares the source observable and replays the bufferSize source Ts
to any of the registering observers.
|
ObservableBuilder<T> |
replay(int bufferSize,
Scheduler scheduler)
Creates an observable which shares the source observable and replays all source Ts
to any of the registering observers.
|
ObservableBuilder<T> |
replay(long timeSpan,
java.util.concurrent.TimeUnit unit)
Creates an observable which shares the source observable and replays all source Ts
to any of the registering observers.
|
ObservableBuilder<T> |
replay(long timeSpan,
java.util.concurrent.TimeUnit unit,
Scheduler scheduler)
Creates an observable which shares the source observable and replays all source Ts
to any of the registering observers.
|
ObservableBuilder<T> |
replay(Scheduler scheduler)
Creates an observable which shares the source observable and replays all source Ts
to any of the registering observers.
|
ObservableBuilder<T> |
resumeAlways(java.lang.Iterable<? extends Observable<? extends T>> sources)
Returns an observable which listens to elements from a source until it signals an error()
or finish() and continues with the next observable.
|
ObservableBuilder<T> |
resumeConditionally(Func1<? super java.lang.Throwable,? extends Observable<? extends T>> handler)
Continues the observable sequence in case of exception
whith the sequence provided by the function for that particular
exception.
|
ObservableBuilder<T> |
resumeOnError(java.lang.Iterable<? extends Observable<? extends T>> sources)
It tries to submit the values of first observable, but when it throws an exeption,
the next observable within source is used further on.
|
ObservableBuilder<T> |
retry()
Restarts the observation until the source observable terminates normally.
|
ObservableBuilder<T> |
retry(int count)
Restarts the observation until the source observable terminates normally or the
count retry count was used up. |
void |
run()
Blocks until the observable calls finish() or error().
|
void |
run(Action1<? super T> action)
Blocks until the observable calls finish() or error().
|
void |
run(Observer<? super T> observer)
Blocks until the observable calls finish() or error().
|
ObservableBuilder<T> |
sample(long time,
java.util.concurrent.TimeUnit unit)
Periodically sample the given source observable, which means tracking the last value of
the observable and periodically submitting it to the output observable.
|
ObservableBuilder<T> |
sample(long time,
java.util.concurrent.TimeUnit unit,
Scheduler pool)
Periodically sample the given source observable, which means tracking the last value of
the observable and periodically submitting it to the output observable.
|
<U> ObservableBuilder<T> |
sample(Observable<? extends U> sampler)
Samples the observable sequence when the other sequence
fires an event.
|
ObservableBuilder<T> |
scan(Func2<? super T,? super T,? extends T> accumulator)
Creates an observable which accumultates the given source and submits each intermediate results to its subscribers.
|
ObservableBuilder<T> |
scan(T seed,
Func2<? super T,? super T,? extends T> accumulator)
Creates an observable which accumultates the given source and submits each intermediate results to its subscribers.
|
<U> ObservableBuilder<U> |
select(Func1<? super T,? extends U> mapper)
Use the mapper to transform the T source into an U source.
|
<U> ObservableBuilder<U> |
select(Func2<? super T,? super java.lang.Integer,? extends U> selector)
Transforms the elements of the source observable into Us by using a selector which receives an index indicating
how many elements have been transformed this far.
|
<U> ObservableBuilder<U> |
selectLong(Func2<? super T,? super java.lang.Long,? extends U> selector)
Transforms the elements of the source observable
into Us by using a selector which receives a long index indicating
how many elements have been transformed this far.
|
<U> ObservableBuilder<U> |
selectMany(Func1<? super T,? extends Observable<? extends U>> selector)
Transform the given source of Ts into Us in a way that the
selector might return an observable ofUs for a single T.
|
<U,V> ObservableBuilder<V> |
selectMany(Func1<? super T,? extends Observable<? extends U>> collectionSelector,
Func2<? super T,? super U,? extends V> resultSelector)
Creates an observable in which for each of Ts an observable of Vs are
requested which in turn will be transformed by the resultSelector for each
pair of T and V giving an U.
|
<U> ObservableBuilder<U> |
selectMany(Observable<? extends U> provider)
Creates an observable of Us in a way when a source T arrives, the observable of
Us is completely drained into the output.
|
<U> ObservableBuilder<U> |
selectManyIterable(Func1<? super T,? extends java.lang.Iterable<? extends U>> selector)
Transform the given source of Ts into Us in a way that the selector might return zero to multiple elements of Us for a single T.
|
<U,V> Observable<V> |
selectManyIterable(Func1<? super T,? extends java.lang.Iterable<? extends U>> selector,
Func2<? super T,? super U,? extends V> resultSelector)
Transform the given source of Ts into Us in a way that the selector might return zero to multiple elements of Us for a single T.
|
ObservableBuilder<java.lang.Boolean> |
sequenceEqual(Observable<? extends T> second)
Compares two sequences and returns whether they are produce the same
elements in terms of the null-safe object equality.
|
ObservableBuilder<java.lang.Boolean> |
sequenceEqual(Observable<? extends T> second,
Func2<? super T,? super T,java.lang.Boolean> comparer)
Compares two sequences and returns whether they are produce the same
elements in terms of the comparer function.
|
T |
single()
Returns the single element of the given observable source.
|
T |
single(Func0<? extends T> defaultSupplier)
Returns the single element of the given observable source,
returns the supplier's value if the source is empty or throws a
TooManyElementsException in case the source has more than one item.
|
T |
single(T defaultValue)
Returns the single element of the given observable source,
returns the default if the source is empty or throws a
TooManyElementsException in case the source has more than one item.
|
ObservableBuilder<T> |
singleAsync()
Returns the only element of the source or throws
NoSuchElementException if the source is empty or TooManyElementsException if
it contains more than one elements.
|
ObservableBuilder<T> |
singleAsync(Func0<? extends T> defaultSupplier)
Returns the only element of the source,
returns the supplier's value if the source is empty or TooManyElementsException if
it contains more than one elements.
|
ObservableBuilder<T> |
singleAsync(T defaultValue)
Returns the only element of the source,
returns the default value if the source is empty or TooManyElementsException if
it contains more than one elements.
|
ObservableBuilder<T> |
skip(int count)
Skips the given amount of next() messages from source and relays
the rest.
|
ObservableBuilder<T> |
skip(long time,
java.util.concurrent.TimeUnit unit)
Skips elements of the source observable for the
specified amount of time.
|
ObservableBuilder<T> |
skip(long time,
java.util.concurrent.TimeUnit unit,
Scheduler pool)
Skips elements of the source observable for the
specified amount of time.
|
ObservableBuilder<T> |
skipLast(int count)
Skips the last
count elements from the source observable. |
ObservableBuilder<T> |
skipLast(long time,
java.util.concurrent.TimeUnit unit)
Skips the elements from the end for the specified amount of time.
|
<U> ObservableBuilder<T> |
skipUntil(Observable<? extends U> signaller)
Skip the source elements until the signaller sends its first element.
|
ObservableBuilder<T> |
skipWhile(Func1<? super T,java.lang.Boolean> condition)
Skips the Ts from source while the specified condition returns true.
|
ObservableBuilder<T> |
skipWhile(Func2<? super T,? super java.lang.Integer,java.lang.Boolean> condition)
Skips the Ts from source while the specified indexed condition returns true.
|
ObservableBuilder<T> |
skipWhileLong(Func2<? super T,? super java.lang.Long,java.lang.Boolean> condition)
Skips the Ts from source while the specified long indexed condition returns true.
|
ObservableBuilder<T> |
startWith(java.lang.Iterable<? extends T> values)
Start with the given iterable of values before relaying the Ts from the
source.
|
ObservableBuilder<T> |
startWith(java.lang.Iterable<? extends T> values,
Scheduler pool)
Start with the given iterable of values before relaying the Ts from the
source.
|
ObservableBuilder<T> |
startWith(Scheduler pool,
T... values)
Start with the given iterable of values before relaying the Ts from the
source.
|
ObservableBuilder<T> |
startWith(T... values)
Start with the given iterable of values before relaying the Ts from the
source.
|
ObservableBuilder<java.math.BigDecimal> |
sumBigDecimal()
Computes and signals the sum of the values of the BigDecimal source.
|
ObservableBuilder<java.math.BigInteger> |
sumBigInteger()
Computes and signals the sum of the values of the BigInteger source.
|
ObservableBuilder<java.lang.Double> |
sumDouble()
Computes and signals the sum of the values of the Double source.
|
ObservableBuilder<java.lang.Float> |
sumFloat()
Computes and signals the sum of the values of the Float source.
|
ObservableBuilder<java.lang.Integer> |
sumInt()
Computes and signals the sum of the values of the Integer source.
|
ObservableBuilder<java.lang.Double> |
sumIntAsDouble()
Computes and signals the sum of the values of the Integer source by using
a double intermediate representation.
|
ObservableBuilder<java.lang.Long> |
sumLong()
Computes and signals the sum of the values of the Long source.
|
ObservableBuilder<java.lang.Double> |
sumLongAsDouble()
Computes and signals the sum of the values of the Long sourceby using
a double intermediate representation.
|
ObservableBuilder<T> |
switchToNext(Observable<? extends Observable<? extends T>> sources)
Returns an observer which relays Ts from the source observables in a way, when
a new inner observable comes in, the previous one is deregistered and the new one is
continued with.
|
ObservableBuilder<T> |
synchronize()
Returns an observable sequence which ensures that
the registering observers follow the general contract
on observables by serializing access to the event
methods.
|
ObservableBuilder<T> |
take(int count)
Creates an observable which takes the specified number of
Ts from the source, unregisters and completes.
|
ObservableBuilder<T> |
take(int count,
Scheduler scheduler)
Creates an observable which takes the specified number of
Ts from the source, unregisters and completes.
|
ObservableBuilder<T> |
take(long time,
java.util.concurrent.TimeUnit unit)
Takes the elements from the source sequence
until the time runs out.
|
ObservableBuilder<T> |
take(long time,
java.util.concurrent.TimeUnit unit,
Scheduler pool)
Takes the elements from the source sequence
until the time runs out.
|
ObservableBuilder<T> |
takeLast(int count)
Returns an observable which returns the last
count
elements from the source observable. |
ObservableBuilder<T> |
takeLast(int count,
Scheduler pool)
Returns an observable which returns the last
count
elements from the source observable and emits them from
the specified scheduler pool. |
ObservableBuilder<T> |
takeLast(long time,
java.util.concurrent.TimeUnit unit)
Skips the elements from the end for the specified amount of time.
|
ObservableBuilder<T> |
takeLast(long time,
java.util.concurrent.TimeUnit unit,
Scheduler drainPool)
Skips the elements from the end for the specified amount of time.
|
ObservableBuilder<java.util.List<T>> |
takeLastBuffer(int count)
Returns an observable which returns the last
count
elements from the source observable and
returns it as a single list. |
ObservableBuilder<java.util.List<T>> |
takeLastBuffer(long time,
java.util.concurrent.TimeUnit unit)
Skips the elements from the end for the specified amount of time
as one list.
|
ObservableBuilder<java.util.List<T>> |
takeLastBuffer(long time,
java.util.concurrent.TimeUnit unit,
Scheduler drainPool)
Skips the elements from the end for the specified amount of time
as one list.
|
<U> ObservableBuilder<T> |
takeUntil(Observable<U> signaller)
Creates an observable which takes values from the source until
the signaller produces a value.
|
ObservableBuilder<T> |
takeWhile(Func1<? super T,java.lang.Boolean> predicate)
Creates an observable which takes values from source until
the predicate returns false for the current element, then skips the remaining values.
|
ObservableBuilder<T> |
takeWhile(Func2<? super T,? super java.lang.Integer,java.lang.Boolean> predicate)
Creates an observable which takes values from source until
the indexed predicate returns false for the current element, then skips the remaining values.
|
ObservableBuilder<T> |
takeWhileLong(Func2<? super T,? super java.lang.Long,java.lang.Boolean> predicate)
Creates an observable which takes values from source until
the long indexed predicate returns false for the current element, then skips the remaining values.
|
<U> ObservableBuilder<T> |
throttle(Func1<? super T,? extends Observable<U>> durationSelector)
Fires the last event from the source observable if
no events are fired during a selector-returned observable window.
|
ObservableBuilder<T> |
throttle(long delay,
java.util.concurrent.TimeUnit unit)
Creates and observable which fires the last value
from source when the given timespan elapsed without a new
value occurring from the source.
|
ObservableBuilder<T> |
throttle(long delay,
java.util.concurrent.TimeUnit unit,
Scheduler pool)
Creates and observable which fires the last value
from source when the given timespan elapsed without a new
value occurring from the source.
|
static <T> ObservableBuilder<T> |
throwException(java.lang.Throwable ex)
Creates an observable which instantly sends the exception to
its subscribers while running on the default pool.
|
static <T> ObservableBuilder<T> |
throwException(java.lang.Throwable ex,
Scheduler pool)
Creates an observable which instantly sends the exception to
its subscribers while running on the given pool.
|
static ObservableBuilder<java.lang.Long> |
tick(long start,
long end,
long delay,
java.util.concurrent.TimeUnit unit)
Returns an observable which produces an ordered sequence of numbers with the specified delay.
|
static ObservableBuilder<java.lang.Long> |
tick(long start,
long end,
long delay,
java.util.concurrent.TimeUnit unit,
Scheduler pool)
Returns an observable which produces an ordered sequence of numbers with the specified delay.
|
static ObservableBuilder<java.lang.Long> |
tick(long delay,
java.util.concurrent.TimeUnit unit)
Returns an observable which produces an ordered sequence of numbers with the specified delay.
|
<V> ObservableBuilder<T> |
timeout(Func1<? super T,? extends Observable<V>> timeoutSelector)
Applies a timeout to each element of the sequence or
throws a TimeoutException if an element is not followed
by another within the firing of the timeout selector's
observable sequence.
|
<V> ObservableBuilder<T> |
timeout(Func1<? super T,? extends Observable<V>> timeoutSelector,
Observable<? extends T> other)
Applies a timeout to each element in the source sequence,
for each element a separate window is opened in the
form of observable sequence.
|
ObservableBuilder<T> |
timeout(long time,
java.util.concurrent.TimeUnit unit)
Creates an observable which relays events if they arrive
from the source observable within the specified amount of time
or it singlals a java.util.concurrent.TimeoutException.
|
ObservableBuilder<T> |
timeout(long time,
java.util.concurrent.TimeUnit unit,
Observable<? extends T> other)
Creates an observable which relays events if they arrive
from the source observable within the specified amount of time
or it switches to the
other observable. |
ObservableBuilder<T> |
timeout(long time,
java.util.concurrent.TimeUnit unit,
Observable<? extends T> other,
Scheduler pool)
Creates an observable which relays events if they arrive
from the source observable within the specified amount of time
or it switches to the
other observable. |
ObservableBuilder<T> |
timeout(long time,
java.util.concurrent.TimeUnit unit,
Scheduler pool)
Creates an observable which relays events if they arrive
from the source observable within the specified amount of time
or it singlals a java.util.concurrent.TimeoutException.
|
<U,V> ObservableBuilder<T> |
timeout(Observable<U> firstTimeout,
Func1<? super T,? extends Observable<V>> timeoutSelector)
Applies a timeout to each element of the sequence or
throws a TimeoutException if an element is not followed
by another within the firing of the timeout selector's
observable sequence.
|
<U,V> ObservableBuilder<T> |
timeout(Observable<U> firstTimeout,
Func1<? super T,? extends Observable<V>> timeoutSelector,
Observable<? extends T> other)
Applies a timeout to each element in the source sequence,
starting with the timeout from the firsTimeout observabe,
then, for each element a separate window is opened in the
form of observable sequence.
|
ObservableBuilder<T> |
timeoutFinish(long time,
java.util.concurrent.TimeUnit unit)
Creates an observable which finishes its observers after the specified
amount of time if no error or finish events appeared till then.
|
ObservableBuilder<T> |
timeoutFinish(long time,
java.util.concurrent.TimeUnit unit,
Scheduler scheduler)
Creates an observable which finishes its observers after the specified
amount of time if no error or finish events appeared till then.
|
ObservableBuilder<java.lang.Object[]> |
toArray()
Creates an array from the observable sequence elements.
|
ObservableBuilder<T[]> |
toArray(T[] a)
Creates an array from the observable sequence elements by using the given
array for the template to create a dynamicly typed array of Ts.
|
IterableBuilder<T> |
toIterable()
Converts this observable into an iterable builder.
|
ObservableBuilder<java.util.List<T>> |
toList()
Collect the elements of the source observable into a single list.
|
<K> ObservableBuilder<java.util.Map<K,T>> |
toMap(Func1<? super T,? extends K> keySelector)
Maps the given source of Ts by using the key extractor and
returns a single Map of them.
|
<K,V> ObservableBuilder<java.util.Map<K,V>> |
toMap(Func1<? super T,? extends K> keySelector,
Func1<? super T,? extends V> valueSelector)
Maps the given source of Ts by using the key extractor and
returns a single Map of them.
|
<K,V> ObservableBuilder<java.util.Map<K,V>> |
toMap(Func1<? super T,? extends K> keySelector,
Func1<? super T,? extends V> valueSelector,
Func2<? super K,? super K,java.lang.Boolean> keyComparer)
Maps the given source of Ts by using the key and value extractor and
returns a single Map of them.
|
<K> ObservableBuilder<java.util.Map<K,T>> |
toMap(Func1<? super T,? extends K> keySelector,
Func2<? super K,? super K,java.lang.Boolean> keyComparer)
Maps the given source of Ts by using the key extractor and
returns a single Map of them.
|
<K> ObservableBuilder<java.util.Map<K,java.util.Collection<T>>> |
toMultiMap(Func1<? super T,? extends K> keySelector,
Func0<? extends java.util.Collection<T>> collectionSupplier)
Maps the given source of Ts by using the key extractor and
returns a single multi-map of them.
|
<K> ObservableBuilder<java.util.Map<K,java.util.Collection<T>>> |
toMultiMap(Func1<? super T,? extends K> keySelector,
Func0<? extends java.util.Collection<T>> collectionSupplier,
Func2<? super K,? super K,java.lang.Boolean> keyComparer)
Maps the given source of Ts by using the key extractor and
returns a single multi-map of them.
|
<K,V> ObservableBuilder<java.util.Map<K,java.util.Collection<V>>> |
toMultiMap(Func1<? super T,? extends K> keySelector,
Func0<? extends java.util.Collection<V>> collectionSupplier,
Func1<? super T,? extends V> valueSelector)
Maps the given source of Ts by using the key and value extractor and
returns a single multi-map of them.
|
<K,V> ObservableBuilder<java.util.Map<K,java.util.Collection<V>>> |
toMultiMap(Func1<? super T,? extends K> keySelector,
Func0<? extends java.util.Collection<V>> collectionSupplier,
Func1<? super T,? extends V> valueSelector,
Func2<? super K,? super K,java.lang.Boolean> keyComparer)
Maps the given source of Ts by using the key and value extractor and
returns a single multi-map of them.
|
java.util.Observable |
toOriginalObservable() |
Observable<T> |
unwrap() |
ObservableBuilder<T> |
where(Func0<Func2<? super T,? super java.lang.Integer,java.lang.Boolean>> clauseFactory)
Creates a filtered observable where only Ts are relayed which satisfy the clause.
|
ObservableBuilder<T> |
where(Func1<? super T,java.lang.Boolean> clause)
Creates a filtered observable where only Ts are relayed which satisfy the clause.
|
ObservableBuilder<T> |
where(Func2<? super T,? super java.lang.Integer,java.lang.Boolean> clause)
Creates a filtered observable where only Ts are relayed which satisfy the clause.
|
ObservableBuilder<T> |
whereLong(Func2<? super T,? super java.lang.Long,java.lang.Boolean> clause)
Creates a filtered observable where only Ts are relayed which satisfy the clause.
|
ObservableBuilder<T> |
whileDo(Func0<java.lang.Boolean> condition)
Repeatedly registers with the source observable
if the condition holds on registration.
|
<U> ObservableBuilder<Observable<T>> |
window(Func0<? extends Observable<U>> windowClosing)
Splits the source stream into separate observables once
the windowClosing fires an event.
|
ObservableBuilder<Observable<T>> |
window(int size)
Project the source sequence to
non-overlapping windows with the given
size.
|
Observable<Observable<T>> |
window(int size,
int skip)
Project the source sequence to
potentially overlapping windows whose
start is determined by skip and lengths
by size.
|
ObservableBuilder<Observable<T>> |
window(int size,
long timespan,
java.util.concurrent.TimeUnit unit)
Projects each element into a window that
is completed by either its full or the specified
amount of time elapsed.
|
ObservableBuilder<Observable<T>> |
window(int size,
long timespan,
java.util.concurrent.TimeUnit unit,
Scheduler pool)
Projects each element into a window that
is completed by either its full or the specified
amount of time elapsed.
|
ObservableBuilder<Observable<T>> |
window(long timespan,
long timeshift,
java.util.concurrent.TimeUnit unit)
Projects elements from the source observable
into zero or more windows which are produced
based on timing information.
|
ObservableBuilder<Observable<T>> |
window(long timespan,
long timeshift,
java.util.concurrent.TimeUnit unit,
Scheduler pool)
Projects elements from the source observable
into zero or more windows which are produced
based on timing information and run
on the specified scheduler.
|
ObservableBuilder<Observable<T>> |
window(long timespan,
java.util.concurrent.TimeUnit unit)
Projects elements from the source observable
into distinct windows which are produced
based on timing information.
|
ObservableBuilder<Observable<T>> |
window(long timespan,
java.util.concurrent.TimeUnit unit,
Scheduler pool)
Projects elements from the source observable
into zero or more windows which are produced
based on timing information and run
on the specified scheduler.
|
<U,V> ObservableBuilder<Observable<T>> |
window(Observable<? extends U> windowOpening,
Func1<? super U,? extends Observable<V>> windowClosing)
Splits the source stream into separate observables
by starting at windowOpening events and closing at windowClosing events.
|
<U> Observable<Observable<T>> |
window(Observable<U> boundary)
Projects the source elements into a non-overlapping consecutive windows.
|
<U,V> ObservableBuilder<V> |
zip(java.lang.Iterable<? extends U> right,
Func2<? super T,? super U,? extends V> selector)
Creates an observable which waits for events from left
and combines it with the next available value from the right iterable,
applies the selector function and emits the resulting T.
|
<U,V> ObservableBuilder<V> |
zip(Observable<? extends U> right,
Func2<T,U,V> selector)
Creates an observable which waits for events from left
and combines it with the next available value from the right observable,
applies the selector function and emits the resulting T.
|
ObservableBuilder<java.util.List<T>> |
zipFirst(T constant)
Combine a stream of Ts with a constant T whenever the src fires.
|
ObservableBuilder<java.util.List<T>> |
zipLast(java.util.List<? extends Observable<? extends T>> srcs)
Combine the incoming Ts of the various observables into a single list of Ts like
using Reactive.zip() on more than two sources.
|
ObservableBuilder<java.util.List<T>> |
zipLast(T constant)
Combine a constant T with a stream of Ts whenever the src fires.
|
@Nonnull protected final Observable<T> o
protected ObservableBuilder(@Nonnull
Observable<T> source)
source - the source sequence@Nonnull public static <T> ObservableBuilder<T> defer(@Nonnull Func0<? extends Observable<? extends T>> observableFactory)
observableFactory whenever an observer
tries to subscribe to it.T - the element typeobservableFactory - the factory which is responsivle to create a source observable.@Nonnull public static ObservableBuilder<java.lang.Void> from(@Nonnull Action0 action)
action - the action to invoke@Nonnull public static ObservableBuilder<java.lang.Void> from(@Nonnull Action0 action, @Nonnull Scheduler pool)
action - the action to invokepool - the pool where the action should run@Nonnull public static <T> ObservableBuilder<T> from(@Nonnull java.util.concurrent.Callable<? extends T> call)
T - the return typecall - the callable@Nonnull public static <T> ObservableBuilder<T> from(@Nonnull java.util.concurrent.Callable<? extends T> call, @Nonnull Scheduler pool)
T - the return typecall - the callablepool - the thread pool@Nonnull public static <T> ObservableBuilder<T> from(@Nonnull Func0<? extends T> func)
T - the function return typefunc - the function@Nonnull public static <T> ObservableBuilder<T> from(@Nonnull Func0<? extends T> func, @Nonnull Scheduler pool)
T - the function return typefunc - the functionpool - the pool where the action should run@Nonnull public static <T> ObservableBuilder<T> from(@Nonnull java.lang.Iterable<? extends T> source)
T - the element typesource - the source iterable@Nonnull public static <T> ObservableBuilder<T> from(@Nonnull java.lang.Iterable<? extends T> source, @Nonnull Scheduler scheduler)
T - the element typesource - the source iterablescheduler - the scheduler to emit the values@Nonnull public static <T> ObservableBuilder<T> from(@Nonnull Observable<T> source)
T - the element typesource - the source observable@Nonnull public static <T> ObservableBuilder<T> from(@Nonnull java.lang.Runnable run)
T - the return typerun - the runnable@Nonnull public static <T> ObservableBuilder<T> from(@Nonnull java.lang.Runnable run, @Nonnull Scheduler pool)
T - the return typerun - the runnablepool - the thread pool@Nonnull public static <T> ObservableBuilder<T> from(@Nonnull java.lang.Runnable run, T defaultValue)
T - the return typerun - the runnabledefaultValue - the value to return when the Runnable completes@Nonnull public static <T> ObservableBuilder<T> from(@Nonnull java.lang.Runnable run, T defaultValue, @Nonnull Scheduler pool)
T - the return typerun - the runnablepool - the thread pooldefaultValue - the value to return by default@Nonnull public static <T> ObservableBuilder<T> from(@Nonnull Scheduler scheduler, @Nonnull T... ts)
T - the element typescheduler - the scheduler to emit the valuests - the element array@Nonnull public static <T> ObservableBuilder<T> from(@Nonnull T... ts)
T - the element typets - the element array@Nonnull public static <T> ObservableBuilder<T> fromOriginal(@Nonnull java.util.Observable javaObservable)
Note that since java-observables are not generic, ClassCastException might occur if the transmitted value has incompatible class.
Remark: named as fromOriginal to avoid casts to java- or reactive observable when using a hybrid source.
T - the element typejavaObservable - the java observable to be used@Nonnull public static <T> ObservableBuilder<T> fromPart(int start, int end, @Nonnull Scheduler scheduler, @Nonnull T... ts)
T - the element typestart - the start index inclusiveend - the end index exclusivescheduler - the scheduler to emit the valuests - the element array@Nonnull public static <T> ObservableBuilder<T> fromPart(int start, int end, @Nonnull T... ts)
T - the element typestart - the start index inclusiveend - the end index exclusivets - the element array@Nonnull public static <T,U> ObservableBuilder<U> generate(T initial, @Nonnull Func1<? super T,java.lang.Boolean> condition, @Nonnull Func1<? super T,? extends T> next, @Nonnull Func1<? super T,? extends U> selector)
T - the type of the generator valuesU - the type of the observed valuesinitial - the initial generator valuecondition - the condition that must hold to continue generating Tsnext - the function that computes the next value of Tselector - the selector which turns Ts into Us.@Nonnull public static <T,U> ObservableBuilder<U> generate(T initial, @Nonnull Func1<? super T,java.lang.Boolean> condition, @Nonnull Func1<? super T,? extends T> next, @Nonnull Func1<? super T,? extends U> selector, @Nonnull Scheduler pool)
T - the type of the generator valuesU - the type of the observed valuesinitial - the initial generator valuecondition - the condition that must hold to continue generating Tsnext - the function that computes the next value of Tselector - the selector which turns Ts into Us.pool - the thread pool where the generation loop should run.@Nonnull public static <T,U> ObservableBuilder<Timestamped<U>> generateTimed(T initial, @Nonnull Func1<? super T,java.lang.Boolean> condition, @Nonnull Func1<? super T,? extends T> next, @Nonnull Func1<? super T,? extends U> selector, @Nonnull Func1<? super T,java.lang.Long> delay)
T - the type of the generator valuesU - the type of the observed valuesinitial - the initial generator valuecondition - the condition that must hold to continue generating Tsnext - the function that computes the next value of Tselector - the selector which turns Ts into Us.delay - the selector which tells how much to wait before releasing the next U@Nonnull public static <T,U> ObservableBuilder<Timestamped<U>> generateTimed(T initial, @Nonnull Func1<? super T,java.lang.Boolean> condition, @Nonnull Func1<? super T,? extends T> next, @Nonnull Func1<? super T,? extends U> selector, @Nonnull Func1<? super T,java.lang.Long> delay, @Nonnull Scheduler pool)
T - the type of the generator valuesU - the type of the observed valuesinitial - the initial generator valuecondition - the condition that must hold to continue generating Tsnext - the function that computes the next value of Tselector - the selector which turns Ts into Us.delay - the selector which tells how much to wait (in milliseconds) before releasing the next Upool - the scheduled pool where the generation loop should run.@Nonnull public static <T> ObservableBuilder<T> newBuilder(@Nonnull Observable<T> source)
T - the element typesource - the source obbservable@Nonnull public static ObservableBuilder<java.math.BigDecimal> range(@Nonnull java.math.BigDecimal start, int count, @Nonnull java.math.BigDecimal step)
start - the start value.count - the countstep - the stepping@Nonnull public static ObservableBuilder<java.math.BigDecimal> range(@Nonnull java.math.BigDecimal start, int count, @Nonnull java.math.BigDecimal step, @Nonnull Scheduler pool)
start - the start value.count - the countstep - the steppingpool - the execution thread pool.@Nonnull public static ObservableBuilder<java.math.BigInteger> range(@Nonnull java.math.BigInteger start, @Nonnull java.math.BigInteger count)
start - the start value.count - the count@Nonnull public static ObservableBuilder<java.math.BigInteger> range(@Nonnull java.math.BigInteger start, @Nonnull java.math.BigInteger count, @Nonnull Scheduler pool)
start - the start value.count - the countpool - the execution thread pool.@Nonnull public static ObservableBuilder<java.lang.Double> range(double start, int count, double step)
start - the start value.count - the countstep - the steppingpublic static ObservableBuilder<java.lang.Double> range(double start, int count, double step, @Nonnull Scheduler pool)
start in count
amount and each subsequent element has a difference of step.start - the starting valuecount - how many values to producestep - the incrementation amountpool - the pool where to emit the values@Nonnull public static ObservableBuilder<java.lang.Float> range(float start, int count, float step)
start - the start value.count - the countstep - the stepping@Nonnull public static ObservableBuilder<java.lang.Float> range(float start, int count, float step, @Nonnull Scheduler pool)
start in count
amount and each subsequent element has a difference of step.start - the starting valuecount - how many values to producestep - the incrementation amountpool - the pool where to emit the values@Nonnull public static ObservableBuilder<java.lang.Integer> range(int start, int count)
start - the start value.count - the count@Nonnull public static ObservableBuilder<java.lang.Integer> range(int start, int count, @Nonnull Scheduler pool)
start - the start value.count - the countpool - the execution thread pool.@Nonnull public static ObservableBuilder<java.lang.Long> range(long start, long count)
start - the start value.count - the count@Nonnull public static ObservableBuilder<java.lang.Long> range(long start, long count, @Nonnull Scheduler pool)
start - the start value.count - the countpool - the execution thread pool.@Nonnull public static <T> ObservableBuilder<T> repeat(@Nonnull Func0<? extends T> func)
T - the type of elements to producefunc - the function which generates elements@Nonnull public static <T> ObservableBuilder<T> repeat(@Nonnull Func0<? extends T> func, int count)
count times to generate Ts
and runs on the default pool.T - the element typefunc - the function to call to generate valuescount - the numer of times to repeat the value@Nonnull public static <T> ObservableBuilder<T> repeat(@Nonnull Func0<? extends T> func, int count, @Nonnull Scheduler pool)
count times to generate Ts
and runs on the given pool.T - the element typefunc - the function to call to generate valuescount - the numer of times to repeat the valuepool - the pool where the loop should be executedpublic static <T> ObservableBuilder<T> repeat(@Nonnull Func0<? extends T> func, @Nonnull Scheduler pool)
T - the type of elements to producefunc - the function which generates elementspool - the pool where the generator loop runs@Nonnull public static <T> ObservableBuilder<T> repeat(T value)
T - the element typevalue - the value to repeat@Nonnull public static <T> ObservableBuilder<T> repeat(T value, int count)
count times
and runs on the default pool.T - the element typevalue - the value to repeatcount - the numer of times to repeat the value@Nonnull public static <T> ObservableBuilder<T> repeat(T value, int count, @Nonnull Scheduler pool)
count times
and runs on the given pool.T - the element typevalue - the value to repeatcount - the numer of times to repeat the valuepool - the pool where the loop should be executed@Nonnull public static <T> ObservableBuilder<T> repeat(T value, @Nonnull Scheduler pool)
T - the element typevalue - the value to repeatpool - the pool where the loop should be executed@Nonnull public static <T> ObservableBuilder<T> throwException(@Nonnull java.lang.Throwable ex)
T - the element type, irrelevantex - the exception to throw@Nonnull public static <T> ObservableBuilder<T> throwException(@Nonnull java.lang.Throwable ex, @Nonnull Scheduler pool)
T - the element type, irrelevantex - the exception to throwpool - the pool from where to send the values@Nonnull public static ObservableBuilder<java.lang.Long> tick(long start, long end, long delay, @Nonnull java.util.concurrent.TimeUnit unit)
start - the starting value of the tickend - the finishing value of the tick exclusivedelay - the delay valueunit - the time unit of the delay@Nonnull public static ObservableBuilder<java.lang.Long> tick(long start, long end, long delay, @Nonnull java.util.concurrent.TimeUnit unit, @Nonnull Scheduler pool)
start - the starting value of the tick inclusiveend - the finishing value of the tick exclusivedelay - the delay valueunit - the time unit of the delaypool - the scheduler pool for the wait@Nonnull public static ObservableBuilder<java.lang.Long> tick(long delay, @Nonnull java.util.concurrent.TimeUnit unit)
delay - the delay valueunit - the time unit of the delay@Nonnull public ObservableBuilder<TimeInterval<T>> addTimeInterval()
@Nonnull public ObservableBuilder<Timestamped<T>> addTimestamped()
@Nonnull public ObservableBuilder<T> aggregate(@Nonnull Func2<? super T,? super T,? extends T> accumulator)
accumulator - the accumulator function where the first parameter is the current accumulated value and the second is the now received value.@Nonnull public <U,V> ObservableBuilder<V> aggregate(@Nonnull Func2<? super U,? super T,? extends U> sum, @Nonnull Func2<? super U,? super java.lang.Integer,? extends V> divide)
U - the type of the intermediate sum valueV - the type of the final average valuesum - the function which sums the input Ts. The first received T will be acompanied by a null U.divide - the function which perform the final division based on the number of elements@Nonnull public <U> ObservableBuilder<U> aggregate(U seed, @Nonnull Func2<? super U,? super T,? extends U> accumulator)
U - the ouput element typeseed - the initial value of the accumulatoraccumulator - the accumulator function where the first parameter is the current accumulated value and the second is the now received value.@Nonnull public <U,V> ObservableBuilder<V> aggregate(U seed, @Nonnull Func2<? super U,? super T,? extends U> accumulator, @Nonnull Func1<? super U,? extends V> resultSelector)
U - the aggregation intermediate typeV - the result typeseed - the initial value for the aggregationaccumulator - the accumulation functionresultSelector - the result selector@Nonnull public <U,V> ObservableBuilder<V> aggregate(U seed, @Nonnull Func2<? super U,? super T,? extends U> accumulator, @Nonnull Func2<? super U,? super java.lang.Integer,? extends V> divider)
U - the type of the intermediate sum valueV - the type of the final average valueseed - the initieal value for the aggregationaccumulator - the function which sums the input Ts. The first received T will be accompanied by a null U.divider - the function which perform the final division based on the number of elements@Nonnull public ObservableBuilder<java.lang.Boolean> all(@Nonnull Func1<? super T,java.lang.Boolean> predicate)
predicate - the predicate to setisfy@Nonnull public ObservableBuilder<T> amb(@Nonnull java.lang.Iterable<? extends Observable<? extends T>> others)
O3 = Amb(O1, O2) if O1 starts to submit events first, O3 will relay these events and events of O2 will be completely ignoredothers - the iterable sequence of the other observables@Nonnull public ObservableBuilder<T> amb(@Nonnull Observable<? extends T> other)
other - the other observable@Nonnull public ObservableBuilder<java.lang.Boolean> any()
@Nonnull public ObservableBuilder<java.lang.Boolean> any(@Nonnull Func1<? super T,java.lang.Boolean> predicate)
predicate - the predicate to test the values@Nonnull public ObservableBuilder<java.math.BigDecimal> averageBigDecimal()
Note that it uses forced cast of this sequence. If T != BigDecimal the observations might throw a ClassCastException.
@Nonnull public ObservableBuilder<java.math.BigDecimal> averageBigInteger()
Note that it uses forced cast of this sequence. If T != BigInteger the observations might throw a ClassCastException.
@Nonnull public ObservableBuilder<java.lang.Double> averageDouble()
Note that it uses forced cast of this sequence. If T != Double the observations might throw a ClassCastException.
@Nonnull public ObservableBuilder<java.lang.Float> averageFloat()
Note that it uses forced cast of this sequence. If T != Float the observations might throw a ClassCastException.
@Nonnull public ObservableBuilder<java.lang.Double> averageInt()
Note that it uses forced cast of this sequence. If T != Integer the observations might throw a ClassCastException.
@Nonnull public ObservableBuilder<java.lang.Double> averageLong()
Note that it uses forced cast of this sequence. If T != Long the observations might throw a ClassCastException.
public T await()
last()public T await(long time, @Nonnull java.util.concurrent.TimeUnit unit)
The difference from the last operator is that
unlike last, this operator does not treat the error event
as just a termination signal.
time - the wait timeunit - the wait time unitlast()@Nonnull public <U> ObservableBuilder<java.util.List<T>> buffer(@Nonnull Func0<Observable<U>> windowClosingSelector)
U - the window's own type (ignored)windowClosingSelector - the window selector@Nonnull public ObservableBuilder<java.util.List<T>> buffer(int bufferSize)
bufferSize - the target buffer size@Nonnull public ObservableBuilder<java.util.List<T>> buffer(int bufferSize, int skip)
bufferSize - the target buffer sizeskip - the number of elements to skip between buffers.@Nonnull public ObservableBuilder<java.util.List<T>> buffer(int bufferSize, long time, @Nonnull java.util.concurrent.TimeUnit unit)
bufferSize - the allowed buffer sizetime - the time value to wait betveen buffer fillsunit - the time unit@Nonnull public ObservableBuilder<java.util.List<T>> buffer(int bufferSize, long time, @Nonnull java.util.concurrent.TimeUnit unit, @Nonnull Scheduler pool)
bufferSize - the allowed buffer sizetime - the time value to wait betveen buffer fillsunit - the time unitpool - the pool where to schedule the buffer splits@Nonnull public ObservableBuilder<java.util.List<T>> buffer(long time, @Nonnull java.util.concurrent.TimeUnit unit)
time - the time value to split the buffer contents.unit - the time unit of the time@Nonnull public ObservableBuilder<java.util.List<T>> buffer(long time, @Nonnull java.util.concurrent.TimeUnit unit, @Nonnull Scheduler pool)
time - the time value to split the buffer contents.unit - the time unit of the timepool - the scheduled execution pool to use@Nonnull public <U,V> ObservableBuilder<java.util.List<T>> buffer(@Nonnull Observable<? extends U> windowOpening, @Nonnull Func1<? super U,? extends Observable<V>> windowClosing)
Exception semantics: if any Observable throws an error, the whole process terminates with error.
U - the buffer opening selector typeV - the buffer closing element type (irrelevant)windowOpening - the window-open observablewindowClosing - the function that returns a window-close observable
for a value from the window-open@Nonnull public <U> ObservableBuilder<java.util.List<T>> buffer(@Nonnull Observable<U> boundary)
Exception semantics: if any Observable throws an error, the whole process terminates with error.
U - the window's own type (ignored)boundary - the notification source of the boundary@Nonnull public <U> ObservableBuilder<U> cast()
U - the output type@Nonnull public <U> ObservableBuilder<U> cast(@Nonnull java.lang.Class<U> token)
U - the output typetoken - the token to test agains the elements@Nonnull public java.lang.Iterable<java.util.List<T>> chunkify()
Reactive.chunkify(Observable)@Nonnull
public <U> java.lang.Iterable<U> collect(@Nonnull
Func0<? extends U> newCollector,
@Nonnull
Func2<? super U,? super T,? extends U> merge)
U - the result typenewCollector - the factory method for the current collectormerge - the merger that combines elementsReactive.collect(Observable, Func0, Func2)@Nonnull public <U> CloseableIterable<U> collect(@Nonnull Func0<? extends U> initialCollector, @Nonnull Func2<? super U,? super T,? extends U> merge, @Nonnull Func1<? super U,? extends U> newCollector)
U - the result element typeinitialCollector - the initial collector factorymerge - the merger operatornewCollector - the factory to replace the current collectorReactive.collect(Observable, Func0, Func2, Func1)@Nonnull public ObservableBuilder<java.util.List<T>> combineFirst(@Nonnull java.util.List<? extends Observable<? extends T>> srcs)
srcs - the iterable of observable sources.@Nonnull public <U,V> ObservableBuilder<V> combineLatest(@Nonnull Observable<? extends U> right, @Nonnull Func2<? super T,? super U,? extends V> selector)
Exception semantics: if any stream throws an exception, the output stream throws an exception and all subscriptions are terminated.
Completion semantics: The output stream terminates after both streams terminate.
The function will start combining the values only when both sides have already sent a value.
U - the right element typeV - the result element typeright - the right streamselector - the function which combines values from both streams and returns a new value@Nonnull public <U,V> ObservableBuilder<V> combineLatest0(@Nonnull Observable<? extends U> right, @Nonnull Func2<? super T,? super U,? extends V> selector)
Exception semantics: if any stream throws an exception, the output stream throws an exception and all subscriptions are terminated.
Completion semantics: The output stream terminates after both streams terminate.
Note that at the beginning, when the left or right fires first, the selector function
will receive (value, null) or (null, value). If you want to react only in cases when both have sent
a value, use the #combineLatest(Observable, Observable, Func2) method.
U - the right element typeV - the result element typeright - the right streamselector - the function which combines values from both streams and returns a new value@Nonnull public ObservableBuilder<T> concat(@Nonnull java.lang.Iterable<? extends Observable<? extends T>> sources)
sources - the source list of subsequent observables@Nonnull public ObservableBuilder<T> concat(@Nonnull Observable<? extends T> second)
second - the second observable@Nonnull public ObservableBuilder<T> concatAll(@Nonnull Observable<? extends Observable<? extends T>> sources)
Exception semantics: if the sources or any inner observer signals an error, the outer observable will signal that error and the sequence is terminated.
sources - the observable sequence of the observable sequence of Ts.@Nonnull public java.io.Closeable connect()
@Nonnull public ObservableBuilder<java.lang.Boolean> contains(@Nonnull Func0<? extends T> supplier)
supplier - the supplier for the comparison value@Nonnull public ObservableBuilder<java.lang.Boolean> contains(T value)
value - the value to look for@Nonnull public ObservableBuilder<java.lang.Integer> count()
@Nonnull public ObservableBuilder<java.lang.Integer> count(@Nonnull Func1<? super T,java.lang.Boolean> predicate)
predicate - the predicate function@Nonnull public ObservableBuilder<java.lang.Long> countLong()
@Nonnull public ObservableBuilder<java.lang.Integer> countLong(@Nonnull Func1<? super T,java.lang.Boolean> predicate)
predicate - the predicate function@Nonnull public ObservableBuilder<T> debugState()
@Nonnull public ObservableBuilder<T> defaultIfEmpty(Func0<? extends T> defaultValueFunc)
defaultValueFunc - the default value factory@Nonnull public ObservableBuilder<T> defaultIfEmpty(T defaultValue)
defaultValue - the default value@Nonnull public <U> ObservableBuilder<T> delay(@Nonnull Func1<? super T,? extends Observable<U>> delaySelector)
Exception semantics: Exceptions appearing through any observable will terminate the sequence immediately.
U - the element type of the value delivery observables, irrelevantdelaySelector - for each source value T, it returns an observable
whose next or finish events will deliver the original value T.@Nonnull public ObservableBuilder<T> delay(long time, @Nonnull java.util.concurrent.TimeUnit unit)
time - the time valueunit - the time unit@Nonnull public ObservableBuilder<T> delay(long time, @Nonnull java.util.concurrent.TimeUnit unit, @Nonnull Scheduler pool)
time - the time valueunit - the time unitpool - the pool to use for scheduling@Nonnull public <U,V> ObservableBuilder<T> delay(@Nonnull Observable<U> registerDelay, @Nonnull Func1<? super T,? extends Observable<V>> delaySelector)
Exception semantics: Exceptions appearing through any observable will terminate the sequence immediately.
U - the element type of the registration delaying observable, irrelevantV - the element type of the value delivery observables, irrelevantregisterDelay - if not null, the actual registration to the source
is delayed by the first next or finish event from this observable.delaySelector - for each source value T, it returns an observable
whose next or finish events will deliver the original value T.@Nonnull public ObservableBuilder<T> delayRegister(long time, @Nonnull java.util.concurrent.TimeUnit unit)
time - the time to waitunit - the time unit@Nonnull public ObservableBuilder<T> delayRegister(long time, @Nonnull java.util.concurrent.TimeUnit unit, @Nonnull Scheduler pool)
time - the time to waitunit - the time unitpool - the scheduler pool where to wait.@Nonnull public ObservableBuilder<T> dematerialize()
next* (error|finish)? pattern,
which ensures that no further options are relayed after an error or finish.#materialize(Observable)@Nonnull public ObservableBuilder<T> distinct()
@Nonnull public <U> ObservableBuilder<T> distinct(@Nonnull Func1<? super T,? extends U> keyExtractor, Func2<? super U,? super U,java.lang.Boolean> keyComparer)
U - the key typekeyExtractor - the key extractor functionkeyComparer - the key comparer function.@Nonnull public <U> ObservableBuilder<T> distinct(@Nonnull Func1<T,U> keyExtractor)
U - the key typekeyExtractor - the key extractor@Nonnull public ObservableBuilder<T> distinct(Func2<? super T,? super T,java.lang.Boolean> comparer)
comparer - the element comparer@Nonnull public ObservableBuilder<T> doWhile(@Nonnull Func0<java.lang.Boolean> condition)
Exception semantics: exception received will stop the repeat process and is delivered to observers as-is.
condition - the condition to check@Nonnull public ObservableBuilder<java.lang.Void> drain(@Nonnull Func1<? super T,? extends Observable<java.lang.Void>> pump)
pump - the pump that drains the queue@Nonnull public ObservableBuilder<java.lang.Void> drain(@Nonnull Func1<? super T,? extends Observable<java.lang.Void>> pump, @Nonnull Scheduler pool)
pump - the pump that drains the queuepool - the pool for the drain@Nonnull public ObservableBuilder<T> elementAt(int index)
Exception semantics: errors from source are propagated as-is.
index - the index to look at@Nonnull public ObservableBuilder<T> elementAt(int index, @Nonnull Func0<? extends T> defaultSupplier)
Exception semantics: errors from source are propagated as-is.
index - the index to look atdefaultSupplier - the function that will supply the default value@Nonnull public ObservableBuilder<T> elementAt(int index, T defaultValue)
Exception semantics: errors from source are propagated as-is.
index - the index to look atdefaultValue - the value to return if the sequence is sorter than index@Nonnull public ObservableBuilder<T> empty()
@Nonnull public ObservableBuilder<T> empty(@Nonnull Scheduler pool)
pool - the pool to invoke the the finish()@Nonnull public ObservableBuilder<T> finish(@Nonnull Action0 action)
action - the action to invoke on finish() or error()public T first()
public T first(@Nonnull Func0<? extends T> defaultSupplier)
defaultSupplier - the supplier of default value in case the source is emptypublic T first(T defaultValue)
defaultValue - the default value in case the observable is empty@Nonnull public ObservableBuilder<T> firstAsync()
Exception semantics: errors from source are propagated as-is.
@Nonnull public ObservableBuilder<T> firstAsync(@Nonnull Func0<? extends T> defaultSupplier)
Exception semantics: errors from source are propagated as-is.
defaultSupplier - the default value supplier@Nonnull public ObservableBuilder<T> firstAsync(T defaultValue)
Exception semantics: errors from source are propagated as-is.
defaultValue - the default value to returnpublic void forEach(@Nonnull
Action1<? super T> action)
throws java.lang.InterruptedException
The observation of the source is not serialized,
therefore, action might be invoked concurrently
by subsequent source elements.
action - the action to invoke on each element.java.lang.InterruptedException - if the wait is interruptedpublic boolean forEach(@Nonnull
Action1<? super T> action,
long time,
@Nonnull
java.util.concurrent.TimeUnit unit)
throws java.lang.InterruptedException
The observation of the source is not serialized,
therefore, action might be invoked concurrently
by subsequent source elements.
action - the action to invoke on each element.time - the waiting timeunit - the waiting time unitjava.lang.InterruptedException - if the wait is interruptedpublic void forEach(@Nonnull
Action2<? super T,? super java.lang.Integer> action)
throws java.lang.InterruptedException
The observation of the source is not serialized,
therefore, action might be invoked concurrently
by subsequent source elements.
action - the action to invoke on each element.java.lang.InterruptedException - if the wait is interruptedpublic boolean forEach(@Nonnull
Action2<? super T,? super java.lang.Integer> action,
long time,
@Nonnull
java.util.concurrent.TimeUnit unit)
throws java.lang.InterruptedException
The observation of the source is not serialized,
therefore, action might be invoked concurrently
by subsequent source elements.
action - the action to invoke on each element.time - the waiting timeunit - the waiting time unitjava.lang.InterruptedException - if the wait is interrupted@Nonnull public ObservableBuilder<java.util.List<T>> forkJoin(@Nonnull java.lang.Iterable<? extends Observable<? extends T>> sources)
sources - the list of sources@Nonnull public <Key> ObservableBuilder<GroupedObservable<Key,T>> groupBy(@Nonnull Func1<? super T,? extends Key> keyExtractor)
Key - the key type of the groupkeyExtractor - the key extractor which creates Keys from Ts@Nonnull public <U,Key> ObservableBuilder<GroupedObservable<Key,U>> groupBy(@Nonnull Func1<? super T,? extends Key> keyExtractor, @Nonnull Func1<? super T,? extends U> valueExtractor)
U - the type of the output elementKey - the key type of the groupkeyExtractor - the key extractor which creates Keys from TsvalueExtractor - the extractor which makes Us from Ts@Nonnull public <K,D> ObservableBuilder<GroupedObservable<K,T>> groupByUntil(@Nonnull Func1<? super T,? extends K> keySelector, @Nonnull Func1<? super GroupedObservable<K,T>,? extends Observable<D>> durationSelector)
The key comparison is done by the Object.equals() semantics of the HashMap.
Exception semantics: if the source throws an exception, all active groups will receive the exception followed by the outer observer of the groups.
Completion semantics: if the source finishes, all active groups will receive a finish signal followed by the outer observer.
K - the key typeD - the duration element type, ignoredkeySelector - the key extractordurationSelector - the observable for a particular group termination@Nonnull public <K,D> ObservableBuilder<GroupedObservable<K,T>> groupByUntil(@Nonnull Func1<? super T,? extends K> keySelector, @Nonnull Func1<? super GroupedObservable<K,T>,? extends Observable<D>> durationSelector, @Nonnull Func2<? super K,? super K,java.lang.Boolean> keyComparer)
Exception semantics: if the source throws an exception, all active groups will receive the exception followed by the outer observer of the groups.
Completion semantics: if the source finishes, all active groups will receive a finish signal followed by the outer observer.
K - the key typeD - the duration element type, ignoredkeySelector - the key extractordurationSelector - the observable for a particular group terminationkeyComparer - the key comparer for the grouping@Nonnull public <K,V,D> ObservableBuilder<GroupedObservable<K,V>> groupByUntil(@Nonnull Func1<? super T,? extends K> keySelector, @Nonnull Func1<? super T,? extends V> valueSelector, @Nonnull Func1<? super GroupedObservable<K,V>,? extends Observable<D>> durationSelector)
The key comparison is done by the Object.equals() semantics of the HashMap.
Exception semantics: if the source throws an exception, all active groups will receive the exception followed by the outer observer of the groups.
Completion semantics: if the source finishes, all active groups will receive a finish signal followed by the outer observer.
K - the key typeV - the value typeD - the duration element type, ignoredkeySelector - the key extractorvalueSelector - the value extractordurationSelector - the observable for a particular group termination@Nonnull public <K,V,D> ObservableBuilder<GroupedObservable<K,V>> groupByUntil(@Nonnull Func1<? super T,? extends K> keySelector, @Nonnull Func1<? super T,? extends V> valueSelector, @Nonnull Func1<? super GroupedObservable<K,V>,? extends Observable<D>> durationSelector, @Nonnull Func2<? super K,? super K,java.lang.Boolean> keyComparer)
Exception semantics: if the source throws an exception, all active groups will receive the exception followed by the outer observer of the groups.
Completion semantics: if the source finishes, all active groups will receive a finish signal followed by the outer observer.
K - the key typeV - the value typeD - the duration element type, ignoredkeySelector - the key extractorvalueSelector - the value extractordurationSelector - the observable for a particular group terminationkeyComparer - the key comparer for the grouping@Nonnull public <Right,LeftDuration,RightDuration,Result> ObservableBuilder<Result> groupJoin(@Nonnull Observable<? extends Right> right, @Nonnull Func1<? super T,? extends Observable<LeftDuration>> leftDurationSelector, @Nonnull Func1<? super Right,? extends Observable<RightDuration>> rightDurationSelector, @Nonnull Func2<? super T,? super Observable<? extends Right>,? extends Result> resultSelector)
Right - the element type of the right streamLeftDuration - the overlapping duration indicator for the left stream (e.g., the event when it leaves)RightDuration - the overlapping duration indicator for the right stream (e.g., the event when it leaves)Result - the type of the grouping based on the coincidence.right - the right source of elementsleftDurationSelector - the duration selector for a left elementrightDurationSelector - the duration selector for a right elementresultSelector - the selector which will produce the output value#join(Observable, Observable, Func1, Func1, Func2)@Nonnull public ObservableBuilder<T> ignoreValues()
@Nonnull public <U extends java.util.Collection<? super T>> U into(@Nonnull U out)
U - a collection typeout - the output collection@Nonnull public ObservableBuilder<T> invoke(@Nonnull Action1<? super T> action)
action might
have some effect on each individual Ts passing through this filter.action - the action to invoke on every T@Nonnull public ObservableBuilder<T> invoke(@Nonnull Action1<? super T> onNext, @Nonnull Action0 onFinish)
onNext - the action for nextonFinish - the action for finish@Nonnull public ObservableBuilder<T> invoke(@Nonnull Action1<? super T> onNext, @Nonnull Action1<? super java.lang.Throwable> onError)
onNext - the action for nextonError - the action for error@Nonnull public ObservableBuilder<T> invoke(@Nonnull Action1<? super T> onNext, @Nonnull Action1<? super java.lang.Throwable> onError, @Nonnull Action0 onFinish)
onNext - the action for nextonError - the action for erroronFinish - the action for finish@Nonnull public ObservableBuilder<T> invoke(@Nonnull Observer<? super T> observer)
action might
have some effect on each individual Ts passing through this filter.observer - the observer to invoke before any registered observers are called@Nonnull public ObservableBuilder<java.lang.Boolean> isEmpty()
public boolean isInstance(@Nonnull
java.lang.Class<?> clazz)
clazz - the class to check against@Nonnull public <Right,LeftDuration,RightDuration,Result> ObservableBuilder<Result> join(@Nonnull Observable<? extends Right> right, @Nonnull Func1<? super T,? extends Observable<LeftDuration>> leftDurationSelector, @Nonnull Func1<? super Right,? extends Observable<RightDuration>> rightDurationSelector, @Nonnull Func2<? super T,? super Right,? extends Result> resultSelector)
The difference between this operator and the groupJoin operator is that in this case, the result selector takes the concrete left and right elements, whereas the groupJoin associates an observable of rights for each left.
Right - the element type of the right streamLeftDuration - the overlapping duration indicator for the left stream (e.g., the event when it leaves)RightDuration - the overlapping duration indicator for the right stream (e.g., the event when it leaves)Result - the type of the grouping based on the coincidence.right - the right source of elementsleftDurationSelector - the duration selector for a left elementrightDurationSelector - the duration selector for a right elementresultSelector - the selector which will produce the output value#groupJoin(Observable, Observable, Func1, Func1, Func2)public T last()
Exception semantics: the exceptions thrown by the source are ignored and treated as termination signals.
The difference between this and the wait operator is that
it returns the last valid value from before an error or finish, ignoring any
exceptions.
public T last(@Nonnull Func0<? extends T> defaultSupplier)
Exception semantics: the exceptions thrown by the source are ignored and treated as termination signals.
defaultSupplier - the function to provide the default valuepublic T last(T defaultValue)
Exception semantics: the exceptions thrown by the source are ignored and treated as termination signals.
defaultValue - the value to provide if the source is empty@Nonnull public ObservableBuilder<T> lastAsync()
Exception semantics: errors from source are propagated as-is.
@Nonnull public ObservableBuilder<T> lastAsync(@Nonnull Func0<? extends T> defaultSupplier)
Exception semantics: errors from source are propagated as-is.
defaultSupplier - the supplier to produce a value to return in case the source is empty@Nonnull public ObservableBuilder<T> lastAsync(T defaultValue)
Exception semantics: errors from source are propagated as-is.
defaultValue - the default value to return in case the source is empty@Nonnull public IterableBuilder<T> latest()
@Nonnull public <U> ObservableBuilder<U> manySelect(@Nonnull Func1<? super Observable<T>,? extends Observable<U>> selector)
For example, a source sequence of (1, 2, 3) will create three function calls with (1, 2, 3), (2, 3) and (3) as a content.
U - the result element typeselector - the selector function@Nonnull public <U> ObservableBuilder<U> manySelect(@Nonnull Func1<? super Observable<T>,? extends U> selector, @Nonnull Scheduler scheduler)
It is sometimes called the comonadic bind operator and compared to the ContinueWith semantics.
U - the result element typeselector - the selector that extracts an U from the series of Ts.scheduler - the scheduler where the extracted U will be emmitted from.@Nonnull public <U> ObservableBuilder<U> manySelect0(@Nonnull Func1<? super Observable<T>,? extends U> selector)
U - the output typeselector - the selector that extracts an U from the series of Ts.@Nonnull public ObservableBuilder<Option<T>> materialize()
Option value.
The returned observable does not itself signal error or finish.
Its dual is the dematerialize method.#dematerialize(Observable)@Nonnull public <U extends java.lang.Comparable<? super U>> ObservableBuilder<U> max()
U - the element type which must be comparable to itself@Nonnull public ObservableBuilder<T> max(@Nonnull java.util.Comparator<T> comparator)
comparator - the comparator to decide the relation of valuesFunctions.asComparator(Func2)@Nonnull public <Key extends java.lang.Comparable<? super Key>> ObservableBuilder<java.util.List<T>> maxBy(@Nonnull Func1<? super T,? extends Key> keyExtractor)
Ts which had their keys as maximums.
The returned observer may finish() if the source sends finish() without any next().
The generated list is modifiable.Key - the key type, which must be comparable to itselfkeyExtractor - the key extractor to produce Keys from Ts.@Nonnull public <Key> ObservableBuilder<java.util.List<T>> maxBy(@Nonnull Func1<? super T,? extends Key> keyExtractor, @Nonnull java.util.Comparator<? super Key> keyComparator)
Ts which had their keys as maximums.
The returned observer may finish() if the source sends finish() without any next().
The generated list is modifiable.Key - the key typekeyExtractor - the key extractor to produce Keys from Ts.keyComparator - the comparator for the keys@Nonnull public ObservableBuilder<T> merge(@Nonnull java.lang.Iterable<? extends Observable<? extends T>> sources)
sources - the list of sources@Nonnull public ObservableBuilder<T> merge(@Nonnull Observable<? extends T> second)
second - the second observable@Nonnull public ObservableBuilder<T> mergeAll(@Nonnull Observable<? extends Observable<T>> sources)
Exception semantics: if the sources or any inner observer signals an error, the outer observable will signal that error and all active source observers are terminated.
sources - the observable sequence of observable sequence of Ts@Nonnull public <U extends java.lang.Comparable<? super U>> ObservableBuilder<U> min()
U - the self comparable element type@Nonnull public ObservableBuilder<T> min(@Nonnull java.util.Comparator<? super T> comparator)
comparator - the comparator to decide the relation of valuesFunctions.asComparator(Func2)@Nonnull public <Key extends java.lang.Comparable<? super Key>> ObservableBuilder<java.util.List<T>> minBy(@Nonnull Func1<? super T,? extends Key> keyExtractor)
Ts which had their keys as minimums.
The returned observer may finish() if the source sends finish() without any next().
The generated list is modifiable.Key - the key type, which must be comparable to itselfkeyExtractor - the key extractor to produce Keys from Ts.@Nonnull public <Key> ObservableBuilder<java.util.List<T>> minBy(@Nonnull Func1<T,Key> keyExtractor, @Nonnull java.util.Comparator<Key> keyComparator)
Ts which had their keys as minimums.
The returned observer may finish() if the source sends finish() without any next().
The generated list is modifiable.Key - the key typekeyExtractor - the key extractor to produce Keys from Ts.keyComparator - the comparator for the keysFunctions.asComparator(Func2)@Nonnull public IterableBuilder<T> mostRecent(T initialValue)
The returned iterator throws UnsupportedOperationException for its remove() method.
initialValue - the initial value to return until the source actually produces something.@Nonnull public <U,V> Observable<V> multicast(@Nonnull Func0<? extends Subject<? super T,? extends U>> subjectSelector, @Nonnull Func1<? super Observable<? extends U>,? extends Observable<? extends V>> selector)
U - the element type of the intermediate subject's outputV - the result typesubjectSelector - the factory function to create an intermediate
subject which through the source values will be multicasted.selector - the factory method to use the multicasted subject and enforce some policies on it@Nonnull public <U> ObservableBuilder<U> multicast(@Nonnull Observer<? super T> observer, Observable<? extends U> observable)
source
observable as long as there is at least one registration to this output observable.
The observer and observable parameters should denote
the same object which implements both Observable and Observer interfaces.
U - the result element typeobserver - the observer that listens for Ts. Should be the same object as observable.observable - the observable that will produce Us. Should be the same object as observable.@Nonnull public ObservableBuilder<T> never()
@Nonnull public IterableBuilder<T> next()
The returned iterator will throw an UnsupportedOperationException for its
remove() method.
Exception semantics: in case of exception received, the source is disconnected and the exception is rethrown from the iterator's next method as a wrapped RuntimeException if necessary.
@Nonnull public ObservableBuilder<T> observeOn(@Nonnull Scheduler pool)
pool - the target observable@Nonnull public <U> ObservableBuilder<U> ofType(@Nonnull java.lang.Class<U> clazz)
U - the target element typeclazz - the class token@Nonnull public <U extends java.lang.Comparable<? super U>> ObservableBuilder<U> orderBy()
U - the source element type, must be self comparable@Nonnull public ObservableBuilder<T> orderBy(@Nonnull java.util.Comparator<? super T> comparator)
comparator - the value comparator@Nonnull public <U extends java.lang.Comparable<? super U>> ObservableBuilder<T> orderBy(@Nonnull Func1<? super T,? extends U> keySelector)
U - the key type for the ordering, must be self comparablekeySelector - the key selector for comparison@Nonnull public <U> ObservableBuilder<T> orderBy(@Nonnull Func1<? super T,? extends U> keySelector, @Nonnull java.util.Comparator<? super U> keyComparator)
Note that it buffers the elements of source until it
signals finish.
Exception semantics: the exception is relayed and no ordering is performed.
Completion semantics: the output terminates when the source terminates and the sorted values are all submitted.
U - the key type for the orderingkeySelector - the key selector for comparisonkeyComparator - the key comparator functionpublic void print()
Is the same as using this.run(Reactive.print()).
public void println()
Is the same as using this.run(Reactive.println()).
public ObservableBuilder<T> prune()
Basically a replay with buffer size 1.
@Nonnull public <U> ObservableBuilder<U> prune(@Nonnull Func1<? super Observable<? extends T>,? extends Observable<U>> selector)
Basically a replay with buffer size 1.
U - the return element typeselector - the output stream selector@Nonnull public <U> ObservableBuilder<U> prune(@Nonnull Func1<? super Observable<? extends T>,? extends Observable<U>> selector, @Nonnull Scheduler scheduler)
Basically a replay with buffer size 1.
U - the return element typeselector - the output stream selectorscheduler - the scheduler for replaying the single value@Nonnull public ObservableBuilder<T> prune(@Nonnull Scheduler scheduler)
Basically a replay with buffer size 1.
scheduler - the scheduler for replaying the single value@Nonnull public ObservableBuilder<T> publish()
This is a specialization of the multicast operator with a simple forwarding subject.
Reactive.publish(Observable)@Nonnull public <U> ObservableBuilder<U> publish(@Nonnull Func1<? super Observable<? extends T>,? extends Observable<? extends U>> selector)
source observable.
This is a specialization of the multicast operator with a regular subject on U.
U - the result element typeselector - the observable selector that can
use the source sequence as many times as necessary, without
multiple registration.@Nonnull public <U> ObservableBuilder<U> publish(@Nonnull Func1<? super Observable<? extends T>,? extends Observable<? extends U>> selector, T initialValue)
source observable and registering parties
receive the initial value immediately.
This is a specialization of the multicast operator with a regular subject on U.
U - the result element typeselector - the observable selector that can
use the source sequence as many times as necessary, without
multiple registration.initialValue - the value received by registering parties immediately.@Nonnull public ObservableBuilder<T> publish(T initialValue)
Registering parties will immediately receive the initial value but the subsequent values depend upon wether the observer is connected or not.
This is a specialization of the multicast operator with a simple forwarding subject.
initialValue - the initial value the observers will receive when registering@Nonnull public ObservableBuilder<T> publishLast()
Reactive.publish(Observable)@Nonnull public <U> ObservableBuilder<U> publishLast(@Nonnull Func1<? super Observable<? extends T>,? extends Observable<? extends U>> selector)
source and returns the last event of the source.U - the result typeselector - function that can use the multicasted source as many times as necessary without causing new registrations to sourceReactive.publishLast(Observable, Func1)@Nonnull public ObservableBuilder<T> refCount()
The wrapped observable of this builder must implement ConnectableObservable, or else an UnsupportedOperationException is thrown
Reactive.refCount(ConnectableObservable)@Nonnull
public java.io.Closeable register(@Nonnull
java.util.Observer javaObserver)
javaObserver - the java observer to register@Nonnull
public java.io.Closeable register(@Nonnull
Observer<? super T> observer)
Observableregister in interface Observable<T>observer - the observer of Ts or any supertype of it@Nonnull public ObservableBuilder<T> registerOn(@Nonnull Scheduler pool)
pool - the pool to perform the original subscribe() call@Nonnull public ObservableBuilder<T> relayUntil(@Nonnull Func0<java.lang.Boolean> condition)
condition - the condition that must be false to relay Ts@Nonnull public ObservableBuilder<T> relayWhile(@Nonnull Func0<java.lang.Boolean> condition)
condition - the condition that must hold to relay Ts@Nonnull public ObservableBuilder<T> removeTimeInterval()
@Nonnull public ObservableBuilder<T> removeTimestamped()
@Nonnull public ObservableBuilder<T> repeat()
Reactive.repeat(Observable)@Nonnull public ObservableBuilder<T> repeat(int count)
count - the number of times to repeat@Nonnull public ObservableBuilder<T> replay()
@Nonnull public <U> ObservableBuilder<U> replay(@Nonnull Func1<? super Observable<? extends T>,? extends Observable<U>> selector, int bufferSize)
U - the return element typeselector - the output stream selectorbufferSize - the target buffer size@Nonnull public <U> ObservableBuilder<U> replay(@Nonnull Func1<? super Observable<? extends T>,? extends Observable<U>> selector, int bufferSize, long timeSpan, @Nonnull java.util.concurrent.TimeUnit unit)
U - the return element typeselector - the output stream selectorbufferSize - the buffer sizetimeSpan - the window lengthunit - the time unit@Nonnull public <U> ObservableBuilder<U> replay(@Nonnull Func1<? super Observable<? extends T>,? extends Observable<U>> selector, int bufferSize, long timeSpan, @Nonnull java.util.concurrent.TimeUnit unit, @Nonnull Scheduler scheduler)
U - the return element typeselector - the output stream selectorbufferSize - the buffer sizetimeSpan - the window lengthunit - the time unitscheduler - the target scheduler@Nonnull public <U> ObservableBuilder<U> replay(@Nonnull Func1<? super Observable<? extends T>,? extends Observable<U>> selector, int bufferSize, @Nonnull Scheduler scheduler)
U - the return element typeselector - the output stream selectorbufferSize - the target buffer sizescheduler - the scheduler from where the historical elements are emitted@Nonnull public <U> ObservableBuilder<U> replay(@Nonnull Func1<? super Observable<? extends T>,? extends Observable<U>> selector, long timeSpan, @Nonnull java.util.concurrent.TimeUnit unit)
U - the return element typeselector - the output stream selectortimeSpan - the window lengthunit - the time unit@Nonnull public <U> ObservableBuilder<U> replay(@Nonnull Func1<? super Observable<? extends T>,? extends Observable<U>> selector, long timeSpan, @Nonnull java.util.concurrent.TimeUnit unit, @Nonnull Scheduler scheduler)
U - the return element typeselector - the output stream selectortimeSpan - the window lengthunit - the time unitscheduler - the target scheduler@Nonnull public <U> ObservableBuilder<U> replay(@Nonnull Func1<? super Observable<T>,? extends Observable<U>> selector)
U - the output element typeselector - the selector which returns an observable of Us for the given source@Nonnull public ObservableBuilder<T> replay(int bufferSize)
bufferSize - the target buffer size@Nonnull public ObservableBuilder<T> replay(int bufferSize, long timeSpan, java.util.concurrent.TimeUnit unit)
bufferSize - the buffer sizetimeSpan - the window lengthunit - the time unit@Nonnull public ObservableBuilder<T> replay(int bufferSize, long timeSpan, @Nonnull java.util.concurrent.TimeUnit unit, @Nonnull Scheduler scheduler)
bufferSize - the buffer sizetimeSpan - the window lengthunit - the time unitscheduler - the target scheduler@Nonnull public ObservableBuilder<T> replay(int bufferSize, @Nonnull Scheduler scheduler)
bufferSize - the target buffer sizescheduler - the scheduler from where the historical elements are emitted@Nonnull public ObservableBuilder<T> replay(long timeSpan, @Nonnull java.util.concurrent.TimeUnit unit)
timeSpan - the window lengthunit - the time unit@Nonnull public ObservableBuilder<T> replay(long timeSpan, @Nonnull java.util.concurrent.TimeUnit unit, @Nonnull Scheduler scheduler)
timeSpan - the window lengthunit - the time unitscheduler - the target scheduler@Nonnull public ObservableBuilder<T> replay(@Nonnull Scheduler scheduler)
scheduler - the scheduler from where the historical elements are emitted@Nonnull public ObservableBuilder<T> resumeAlways(@Nonnull java.lang.Iterable<? extends Observable<? extends T>> sources)
sources - the list of observables@Nonnull public ObservableBuilder<T> resumeConditionally(@Nonnull Func1<? super java.lang.Throwable,? extends Observable<? extends T>> handler)
Exception semantics: in case of an exception in source, the exception is turned into a continuation, but the second observable's error now terminates the sequence.
Note: Rx calls this Catch.
handler - The exception handler@Nonnull public ObservableBuilder<T> resumeOnError(@Nonnull java.lang.Iterable<? extends Observable<? extends T>> sources)
sources - the available source observables.@Nonnull public ObservableBuilder<T> retry()
@Nonnull public ObservableBuilder<T> retry(int count)
count retry count was used up.count - the retry countpublic void run()
throws java.lang.InterruptedException
java.lang.InterruptedException - if the current thread is interrupted while waiting on
the observable.public void run(@Nonnull
Action1<? super T> action)
throws java.lang.InterruptedException
action - the action to invoke for each valuejava.lang.InterruptedException - if the current thread is interrupted while waiting on
the observable.public void run(@Nonnull
Observer<? super T> observer)
throws java.lang.InterruptedException
observer - the observer to invoke for each eventjava.lang.InterruptedException - if the current thread is interrupted while waiting on
the observable.@Nonnull public ObservableBuilder<T> sample(long time, @Nonnull java.util.concurrent.TimeUnit unit)
time - the time value to waitunit - the time unit@Nonnull public ObservableBuilder<T> sample(long time, @Nonnull java.util.concurrent.TimeUnit unit, @Nonnull Scheduler pool)
time - the time value to waitunit - the time unitpool - the scheduler pool where the periodic submission should happen.@Nonnull public <U> ObservableBuilder<T> sample(@Nonnull Observable<? extends U> sampler)
Exception semantics: exceptions raised anywhere will terminate the sequences.
U - the sampler's element type, irrelevantsampler - the sampler sequence@Nonnull public ObservableBuilder<T> scan(@Nonnull Func2<? super T,? super T,? extends T> accumulator)
range(0, 5).accumulate((x, y) => x + y) produces a sequence of [0, 1, 3, 6, 10];accumulator - the accumulator which takest the current accumulation value and the current observed value
and returns a new accumulated value@Nonnull public ObservableBuilder<T> scan(T seed, @Nonnull Func2<? super T,? super T,? extends T> accumulator)
range(0, 5).accumulate(1, (x, y) => x + y) produces a sequence of [1, 2, 4, 7, 11];seed - the initial value of the accumulationaccumulator - the accumulator which takest the current accumulation value and the current observed value
and returns a new accumulated value@Nonnull public <U> ObservableBuilder<U> select(@Nonnull Func1<? super T,? extends U> mapper)
U - the type of the new observablemapper - the mapper from Ts to Us@Nonnull public <U> ObservableBuilder<U> select(@Nonnull Func2<? super T,? super java.lang.Integer,? extends U> selector)
U - the output element typeselector - the selector taking an index and the current T@Nonnull public <U> ObservableBuilder<U> selectLong(@Nonnull Func2<? super T,? super java.lang.Long,? extends U> selector)
U - the output element typeselector - the selector taking an index and the current T@Nonnull public <U> ObservableBuilder<U> selectMany(@Nonnull Func1<? super T,? extends Observable<? extends U>> selector)
U - the output element typeselector - the selector to return an Iterable of Us@Nonnull public <U,V> ObservableBuilder<V> selectMany(@Nonnull Func1<? super T,? extends Observable<? extends U>> collectionSelector, @Nonnull Func2<? super T,? super U,? extends V> resultSelector)
U - the intermediate element typeV - the output element typecollectionSelector - the selector which returns an observable of intermediate VsresultSelector - the selector which gives an U for a T and V@Nonnull public <U> ObservableBuilder<U> selectMany(@Nonnull Observable<? extends U> provider)
U - the output typeprovider - the source of Us@Nonnull public <U> ObservableBuilder<U> selectManyIterable(@Nonnull Func1<? super T,? extends java.lang.Iterable<? extends U>> selector)
U - the output element typeselector - the selector to return an Iterable of Us@Nonnull public <U,V> Observable<V> selectManyIterable(@Nonnull Func1<? super T,? extends java.lang.Iterable<? extends U>> selector, @Nonnull Func2<? super T,? super U,? extends V> resultSelector)
U - the intermediate type ofV - the output typeselector - the selector to return an Iterable of UsresultSelector - the selector for a pair of T and U@Nonnull public ObservableBuilder<java.lang.Boolean> sequenceEqual(@Nonnull Observable<? extends T> second)
The equality only stands if the two sequence produces the same amount of values and those values are pairwise equal. If one of the sequences terminates before the other, the equality test will return false.
second - the second source of Ts@Nonnull public ObservableBuilder<java.lang.Boolean> sequenceEqual(@Nonnull Observable<? extends T> second, @Nonnull Func2<? super T,? super T,java.lang.Boolean> comparer)
The equality only stands if the two sequence produces the same amount of values and those values are pairwise equal. If one of the sequences terminates before the other, the equality test will return false.
second - the second source of Tscomparer - the equality comparison functionpublic T single()
public T single(@Nonnull Func0<? extends T> defaultSupplier)
defaultSupplier - the function that produces the default value#first(Observable, Func0)public T single(T defaultValue)
defaultValue - the value to return if the source is empty#first(Observable, Object)@Nonnull public ObservableBuilder<T> singleAsync()
@Nonnull public ObservableBuilder<T> singleAsync(@Nonnull Func0<? extends T> defaultSupplier)
defaultSupplier - the function that produces@Nonnull public ObservableBuilder<T> singleAsync(T defaultValue)
defaultValue - the default value to return in case the source is empty@Nonnull public ObservableBuilder<T> skip(int count)
count - the number of messages to skip@Nonnull public ObservableBuilder<T> skip(long time, @Nonnull java.util.concurrent.TimeUnit unit)
Exceptions are always forwarded immediately, even if it occurs before the skip time runs out.
time - the time to waitunit - the unit@Nonnull public ObservableBuilder<T> skip(long time, @Nonnull java.util.concurrent.TimeUnit unit, @Nonnull Scheduler pool)
Exceptions are always forwarded immediately, even if it occurs before the skip time runs out.
time - the time to waitunit - the unitpool - the scheduler@Nonnull public ObservableBuilder<T> skipLast(int count)
count elements from the source observable.count - the number of elements to skip at the end@Nonnull public ObservableBuilder<T> skipLast(long time, @Nonnull java.util.concurrent.TimeUnit unit)
Since there is no way to know the total duration of the sequence, the operator queues elements unit they become older than the specified time, causing the elements to be delayed by time.
time - the time to skip from lastunit - the time unit@Nonnull public <U> ObservableBuilder<T> skipUntil(@Nonnull Observable<? extends U> signaller)
U - the element type of the signaller, irrelevantsignaller - the source of Us@Nonnull public ObservableBuilder<T> skipWhile(@Nonnull Func1<? super T,java.lang.Boolean> condition)
condition - the condition that must turn false in order to start relaying@Nonnull public ObservableBuilder<T> skipWhile(@Nonnull Func2<? super T,? super java.lang.Integer,java.lang.Boolean> condition)
condition - the condition that must turn false in order to start relaying@Nonnull public ObservableBuilder<T> skipWhileLong(@Nonnull Func2<? super T,? super java.lang.Long,java.lang.Boolean> condition)
condition - the condition that must turn false in order to start relaying@Nonnull public ObservableBuilder<T> startWith(@Nonnull java.lang.Iterable<? extends T> values)
values - the values to start with@Nonnull public ObservableBuilder<T> startWith(@Nonnull java.lang.Iterable<? extends T> values, @Nonnull Scheduler pool)
values - the values to start withpool - the pool where the iterable values should be emitted@Nonnull public ObservableBuilder<T> startWith(@Nonnull Scheduler pool, T... values)
pool - the pool where the iterable values should be emittedvalues - the values to start with@Nonnull public ObservableBuilder<T> startWith(@Nonnull T... values)
values - the values to start with@Nonnull public ObservableBuilder<java.math.BigDecimal> sumBigDecimal()
@Nonnull public ObservableBuilder<java.math.BigInteger> sumBigInteger()
@Nonnull public ObservableBuilder<java.lang.Double> sumDouble()
@Nonnull public ObservableBuilder<java.lang.Float> sumFloat()
@Nonnull public ObservableBuilder<java.lang.Integer> sumInt()
@Nonnull public ObservableBuilder<java.lang.Double> sumIntAsDouble()
@Nonnull public ObservableBuilder<java.lang.Long> sumLong()
@Nonnull public ObservableBuilder<java.lang.Double> sumLongAsDouble()
@Nonnull public ObservableBuilder<T> switchToNext(@Nonnull Observable<? extends Observable<? extends T>> sources)
sources - the source of multiple observables of Ts.@Nonnull public ObservableBuilder<T> synchronize()
@Nonnull public ObservableBuilder<T> take(int count)
count - the number of elements to relay@Nonnull public ObservableBuilder<T> take(int count, @Nonnull Scheduler scheduler)
count - the number of elements to relayscheduler - the scheduler to use when emitting a finish if count is zero@Nonnull public ObservableBuilder<T> take(long time, @Nonnull java.util.concurrent.TimeUnit unit)
time - the timeunit - the unit@Nonnull public ObservableBuilder<T> take(long time, @Nonnull java.util.concurrent.TimeUnit unit, @Nonnull Scheduler pool)
time - the timeunit - the unitpool - the pool for timed operation@Nonnull public ObservableBuilder<T> takeLast(int count)
count
elements from the source observable.count - the number elements to return@Nonnull public ObservableBuilder<T> takeLast(int count, @Nonnull Scheduler pool)
count
elements from the source observable and emits them from
the specified scheduler pool.count - the number elements to returnpool - the scheduler where from emit the last values@Nonnull public ObservableBuilder<T> takeLast(long time, @Nonnull java.util.concurrent.TimeUnit unit)
These last elements are drained in the caller's thread of the finish event.
Since there is no way to know the total duration of the sequence, the operator queues elements unit they become older than the specified time, causing the elements to be delayed by time.
time - the timeunit - the unit@Nonnull public ObservableBuilder<T> takeLast(long time, @Nonnull java.util.concurrent.TimeUnit unit, @Nonnull Scheduler drainPool)
These last elements are drained in the given scheduler.
Since there is no way to know the total duration of the sequence, the operator queues elements unit they become older than the specified time, causing the elements to be delayed by time.
time - the timeunit - the unitdrainPool - the optional pool to drain the accumulated values,
if null, the thread of the finish caller is used.@Nonnull public ObservableBuilder<java.util.List<T>> takeLastBuffer(int count)
count
elements from the source observable and
returns it as a single list.count - the number elements to return@Nonnull public ObservableBuilder<java.util.List<T>> takeLastBuffer(long time, @Nonnull java.util.concurrent.TimeUnit unit)
These last elements are drained in the caller's thread of the finish event.
Since there is no way to know the total duration of the sequence, the operator queues elements unit they become older than the specified time, causing the elements to be delayed by time.
time - the timeunit - the unit@Nonnull public ObservableBuilder<java.util.List<T>> takeLastBuffer(long time, @Nonnull java.util.concurrent.TimeUnit unit, @Nonnull Scheduler drainPool)
These last elements are drained in the given scheduler.
Since there is no way to know the total duration of the sequence, the operator queues elements unit they become older than the specified time, causing the elements to be delayed by time.
time - the timeunit - the unitdrainPool - the optional pool to drain the accumulated values,
if null, the thread of the finish caller is used.@Nonnull public <U> ObservableBuilder<T> takeUntil(@Nonnull Observable<U> signaller)
U - the signaller element type, irrelevantsignaller - the source of Us@Nonnull public ObservableBuilder<T> takeWhile(@Nonnull Func1<? super T,java.lang.Boolean> predicate)
predicate - the predicate@Nonnull public ObservableBuilder<T> takeWhile(@Nonnull Func2<? super T,? super java.lang.Integer,java.lang.Boolean> predicate)
predicate - the predicate@Nonnull public ObservableBuilder<T> takeWhileLong(@Nonnull Func2<? super T,? super java.lang.Long,java.lang.Boolean> predicate)
predicate - the predicatepublic <U> ObservableBuilder<T> throttle(@Nonnull Func1<? super T,? extends Observable<U>> durationSelector)
Exception semantics: exceptions from the source and windows are forwarded immediately and the sequence is terminated.
The window close is triggered by either a next or finish event.
U - the window observable's type, irrelevantdurationSelector - the duration selector.@Nonnull public ObservableBuilder<T> throttle(long delay, @Nonnull java.util.concurrent.TimeUnit unit)
delay - how much time should elapse since the last event to actually forward that eventunit - the delay time unit@Nonnull public ObservableBuilder<T> throttle(long delay, @Nonnull java.util.concurrent.TimeUnit unit, @Nonnull Scheduler pool)
delay - how much time should elapse since the last event to actually forward that eventunit - the delay time unitpool - the pool where the delay-watcher should operate@Nonnull public <V> ObservableBuilder<T> timeout(@Nonnull Func1<? super T,? extends Observable<V>> timeoutSelector)
The first element is waited forever, the timeout observables fire on both next and finish events.
Exception semantics: any exceptions thrown are immediately forwarded and the sequence terminated.
V - the per-element timeout type, irrelevanttimeoutSelector - the timeout selector for each value@Nonnull public <V> ObservableBuilder<T> timeout(@Nonnull Func1<? super T,? extends Observable<V>> timeoutSelector, @Nonnull Observable<? extends T> other)
The first element is waited forever, the timeout observables fire on both next and finish events.
Exception semantics: any exceptions thrown are immediately forwarded and the sequence terminated.
V - the per-element timeout type, irrelevanttimeoutSelector - the timeout selector for each valueother - the outer source to switch to in case of timeout@Nonnull public ObservableBuilder<T> timeout(long time, @Nonnull java.util.concurrent.TimeUnit unit)
time - the maximum allowed timespan between eventsunit - the time unit@Nonnull public ObservableBuilder<T> timeout(long time, @Nonnull java.util.concurrent.TimeUnit unit, @Nonnull Observable<? extends T> other)
other observable.time - the maximum allowed timespan between eventsunit - the time unitother - the other observable to continue with in case a timeout occurs@Nonnull public ObservableBuilder<T> timeout(long time, @Nonnull java.util.concurrent.TimeUnit unit, @Nonnull Observable<? extends T> other, @Nonnull Scheduler pool)
other observable.time - the maximum allowed timespan between eventsunit - the time unitother - the other observable to continue with in case a timeout occurspool - the scheduler pool for the timeout evaluation@Nonnull public ObservableBuilder<T> timeout(long time, @Nonnull java.util.concurrent.TimeUnit unit, @Nonnull Scheduler pool)
time - the maximum allowed timespan between eventsunit - the time unitpool - the scheduler pool for the timeout evaluation@Nonnull public <U,V> ObservableBuilder<T> timeout(@Nonnull Observable<U> firstTimeout, @Nonnull Func1<? super T,? extends Observable<V>> timeoutSelector)
The first element is until the given firstTimeout observable fires. The timeout observables fire on both next and finish events.
Exception semantics: any exceptions thrown are immediately forwarded and the sequence terminated.
U - the initial timeout element type, irrelevantV - the per-element timeout type, irrelevantfirstTimeout - the timeout for the first element, use never() to wait for it indefinitelytimeoutSelector - the timeout selector for each value@Nonnull public <U,V> ObservableBuilder<T> timeout(@Nonnull Observable<U> firstTimeout, @Nonnull Func1<? super T,? extends Observable<V>> timeoutSelector, @Nonnull Observable<? extends T> other)
U - the initial timeout element type, irrelevantV - the per-element timeout type, irrelevantfirstTimeout - the timeout for the first element, use never() to wait for it indefinitelytimeoutSelector - the timeout selector for each valueother - the outer source to switch to in case of timeout@Nonnull public ObservableBuilder<T> timeoutFinish(long time, @Nonnull java.util.concurrent.TimeUnit unit)
time - the time to waitunit - the time unit to wait@Nonnull public ObservableBuilder<T> timeoutFinish(long time, @Nonnull java.util.concurrent.TimeUnit unit, @Nonnull Scheduler scheduler)
time - the time to waitunit - the time unit to waitscheduler - the scheduler used for the wait@Nonnull public ObservableBuilder<java.lang.Object[]> toArray()
Exception semantics: if the source throws an exception, that exception is forwarded (e.g., no partial array is created).
@Nonnull public ObservableBuilder<T[]> toArray(@Nonnull T[] a)
Exception semantics: if the source throws an exception, that exception is forwarded (e.g., no partial array is created).
a - the template array, noes not change its value@Nonnull public IterableBuilder<T> toIterable()
@Nonnull public ObservableBuilder<java.util.List<T>> toList()
@Nonnull public <K> ObservableBuilder<java.util.Map<K,T>> toMap(@Nonnull Func1<? super T,? extends K> keySelector)
Object.equals() semantics.
Exception semantics: if the source throws an exception, that exception is forwarded (e.g., no partial map is created).
K - the key typekeySelector - the key selector@Nonnull public <K,V> ObservableBuilder<java.util.Map<K,V>> toMap(@Nonnull Func1<? super T,? extends K> keySelector, @Nonnull Func1<? super T,? extends V> valueSelector)
Object.equals() semantics.
Exception semantics: if the source throws an exception, that exception is forwarded (e.g., no partial map is created).
K - the key typeV - the value typekeySelector - the key selectorvalueSelector - the value selector@Nonnull public <K,V> ObservableBuilder<java.util.Map<K,V>> toMap(@Nonnull Func1<? super T,? extends K> keySelector, @Nonnull Func1<? super T,? extends V> valueSelector, @Nonnull Func2<? super K,? super K,java.lang.Boolean> keyComparer)
Exception semantics: if the source throws an exception, that exception is forwarded (e.g., no partial map is created).
K - the key typeV - the value typekeySelector - the key selectorvalueSelector - the value selectorkeyComparer - the comparison function for keys@Nonnull public <K> ObservableBuilder<java.util.Map<K,T>> toMap(@Nonnull Func1<? super T,? extends K> keySelector, @Nonnull Func2<? super K,? super K,java.lang.Boolean> keyComparer)
Exception semantics: if the source throws an exception, that exception is forwarded (e.g., no partial map is created).
K - the key typekeySelector - the key selectorkeyComparer - the key comparer function@Nonnull public <K> ObservableBuilder<java.util.Map<K,java.util.Collection<T>>> toMultiMap(@Nonnull Func1<? super T,? extends K> keySelector, @Nonnull Func0<? extends java.util.Collection<T>> collectionSupplier)
Object.equals() semantics.
Exception semantics: if the source throws an exception, that exception is forwarded (e.g., no partial map is created).
K - the key typekeySelector - the key selectorcollectionSupplier - the function which retuns a collection to hold the Vs.@Nonnull public <K> ObservableBuilder<java.util.Map<K,java.util.Collection<T>>> toMultiMap(@Nonnull Func1<? super T,? extends K> keySelector, @Nonnull Func0<? extends java.util.Collection<T>> collectionSupplier, @Nonnull Func2<? super K,? super K,java.lang.Boolean> keyComparer)
Exception semantics: if the source throws an exception, that exception is forwarded (e.g., no partial map is created).
K - the key typekeySelector - the key selectorcollectionSupplier - the function which retuns a collection to hold the Vs.keyComparer - the comparison function for keys@Nonnull public <K,V> ObservableBuilder<java.util.Map<K,java.util.Collection<V>>> toMultiMap(@Nonnull Func1<? super T,? extends K> keySelector, @Nonnull Func0<? extends java.util.Collection<V>> collectionSupplier, @Nonnull Func1<? super T,? extends V> valueSelector)
Object.equals() semantics.
Exception semantics: if the source throws an exception, that exception is forwarded (e.g., no partial map is created).
K - the key typeV - the value typekeySelector - the key selectorcollectionSupplier - the function which retuns a collection to hold the Vs.valueSelector - the value selectorFunctions#listSupplier(),
Functions#setSupplier()@Nonnull public <K,V> ObservableBuilder<java.util.Map<K,java.util.Collection<V>>> toMultiMap(@Nonnull Func1<? super T,? extends K> keySelector, @Nonnull Func0<? extends java.util.Collection<V>> collectionSupplier, @Nonnull Func1<? super T,? extends V> valueSelector, @Nonnull Func2<? super K,? super K,java.lang.Boolean> keyComparer)
Exception semantics: if the source throws an exception, that exception is forwarded (e.g., no partial map is created).
K - the key typeV - the value typekeySelector - the key selectorcollectionSupplier - the function which retuns a collection to hold the Vs.valueSelector - the value selectorkeyComparer - the comparison function for keys@Nonnull public java.util.Observable toOriginalObservable()
@Nonnull public Observable<T> unwrap()
@Nonnull public ObservableBuilder<T> where(@Nonnull Func0<Func2<? super T,? super java.lang.Integer,java.lang.Boolean>> clauseFactory)
clauseFactory - the filter clause, the first parameter receives the current index, the second receives the current element@Nonnull public ObservableBuilder<T> where(@Nonnull Func1<? super T,java.lang.Boolean> clause)
clause - the filter clause@Nonnull public ObservableBuilder<T> where(@Nonnull Func2<? super T,? super java.lang.Integer,java.lang.Boolean> clause)
clause - the filter clause, the first parameter receives the current index, the second receives the current element@Nonnull public ObservableBuilder<T> whereLong(@Nonnull Func2<? super T,? super java.lang.Long,java.lang.Boolean> clause)
clause - the filter clause, the first parameter receives the current index, the second receives the current element@Nonnull public ObservableBuilder<T> whileDo(@Nonnull Func0<java.lang.Boolean> condition)
condition - the condition to check before each registration@Nonnull public <U> ObservableBuilder<Observable<T>> window(@Nonnull Func0<? extends Observable<U>> windowClosing)
U - the closing event type, irrelevantwindowClosing - the source of the window splitting events@Nonnull public ObservableBuilder<Observable<T>> window(int size)
size - the window size@Nonnull public Observable<Observable<T>> window(int size, int skip)
size - the window sizeskip - the elements to skip between windows.@Nonnull public ObservableBuilder<Observable<T>> window(int size, long timespan, @Nonnull java.util.concurrent.TimeUnit unit)
size - the window sizetimespan - the window lengthunit - the time unit@Nonnull public ObservableBuilder<Observable<T>> window(int size, long timespan, @Nonnull java.util.concurrent.TimeUnit unit, @Nonnull Scheduler pool)
size - the window sizetimespan - the window lengthunit - the time unitpool - the scheduler to run the timed operations@Nonnull public ObservableBuilder<Observable<T>> window(long timespan, long timeshift, @Nonnull java.util.concurrent.TimeUnit unit)
Uses the default scheduler.
timespan - the length of each windowtimeshift - the interval between the creation of consequtive windowsunit - the time unit@Nonnull public ObservableBuilder<Observable<T>> window(long timespan, long timeshift, @Nonnull java.util.concurrent.TimeUnit unit, @Nonnull Scheduler pool)
timespan - the length of each windowtimeshift - the interval between the creation of consequtive windowsunit - the time unitpool - the scheduler for the timed operations@Nonnull public ObservableBuilder<Observable<T>> window(long timespan, @Nonnull java.util.concurrent.TimeUnit unit)
Uses the default scheduler.
timespan - the length of each windowunit - the time unit@Nonnull public ObservableBuilder<Observable<T>> window(long timespan, @Nonnull java.util.concurrent.TimeUnit unit, @Nonnull Scheduler pool)
timespan - the length of each windowunit - the time unitpool - the scheduler for the timed operations@Nonnull public <U,V> ObservableBuilder<Observable<T>> window(@Nonnull Observable<? extends U> windowOpening, @Nonnull Func1<? super U,? extends Observable<V>> windowClosing)
U - the opening event type, irrelevantV - the closing event type, irrelevantwindowOpening - te source of the window opening eventswindowClosing - the source of the window splitting eventspublic <U> Observable<Observable<T>> window(@Nonnull Observable<U> boundary)
The first window opens immediately, The current window is closed when the boundary observable sequence has sent a value. The finish of the boundary will finish both inner and outer observables.
Exception semantics: exception thrown by the source or the windowClosingSelector's observable is propagated to both the outer and inner observable returned.
U - the window boundary element type (irrelevantboundary - the window boundary indicator.@Nonnull public <U,V> ObservableBuilder<V> zip(@Nonnull java.lang.Iterable<? extends U> right, @Nonnull Func2<? super T,? super U,? extends V> selector)
U - the value type streamed on the left observableV - the value type streamed on the right iterableright - the right iterable of Vsselector - the selector taking the left Us and right Vs.@Nonnull public <U,V> ObservableBuilder<V> zip(@Nonnull Observable<? extends U> right, @Nonnull Func2<T,U,V> selector)
U - the value type streamed on the right iterableV - the result typeright - the right iterable of Vsselector - the selector taking the left Us and right Vs.@Nonnull public ObservableBuilder<java.util.List<T>> zipFirst(T constant)
constant - the constant T to combine with@Nonnull public ObservableBuilder<java.util.List<T>> zipLast(@Nonnull java.util.List<? extends Observable<? extends T>> srcs)
srcs - the iterable of observable sources.@Nonnull public ObservableBuilder<java.util.List<T>> zipLast(T constant)
constant - the constant T to combine with