Package rx.internal.operators
Class OperatorToObservableList<T>
- java.lang.Object
-
- rx.internal.operators.OperatorToObservableList<T>
-
- Type Parameters:
T
- the value type of the input and the output list's items
- All Implemented Interfaces:
Func1<Subscriber<? super java.util.List<T>>,Subscriber<? super T>>
,Function
,Observable.Operator<java.util.List<T>,T>
public final class OperatorToObservableList<T> extends java.lang.Object implements Observable.Operator<java.util.List<T>,T>
Returns anObservable
that emits a single item, a list composed of all the items emitted by the sourceObservable
.Normally, an
Observable
that returns multiple items will do so by invoking its subscriber'sonNext
method for each such item. You can change this behavior, instructing theObservable
to compose a list of all of these multiple items and then to invoke the subscriber'sonNext
method once, passing it the entire list, by using this operator.Be careful not to use this operator on
Observable
s that emit infinite or very large numbers of items, as you do not have the option to unsubscribe.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static class
OperatorToObservableList.Holder
Lazy initialization via inner-class holder.
-
Constructor Summary
Constructors Constructor Description OperatorToObservableList()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Subscriber<? super T>
call(Subscriber<? super java.util.List<T>> o)
static <T> OperatorToObservableList<T>
instance()
-
-
-
Method Detail
-
instance
public static <T> OperatorToObservableList<T> instance()
- Type Parameters:
T
- the value type of the input and the output list's items- Returns:
- a singleton instance of this stateless operator.
-
call
public Subscriber<? super T> call(Subscriber<? super java.util.List<T>> o)
- Specified by:
call
in interfaceFunc1<Subscriber<? super java.util.List<T>>,Subscriber<? super T>>
-
-