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 List<T>>,
,Subscriber<? super T>> Function
,Observable.Operator<List<T>,
T>
public final class OperatorToObservableList<T>
extends Object
implements Observable.Operator<List<T>,T>
Returns an
Observable
that emits a single item, a list composed of all the items emitted by the
source Observable
.
Normally, an Observable
that returns multiple items will do so by invoking its subscriber's
onNext
method for each such item. You can change this behavior, instructing the
Observable
to compose a list of all of these multiple items and then to invoke the subscriber's
onNext
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 ClassesModifier and TypeClassDescription(package private) static final class
Lazy initialization via inner-class holder. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionSubscriber
<? super T> call
(Subscriber<? super List<T>> o) static <T> OperatorToObservableList
<T> instance()
-
Constructor Details
-
OperatorToObservableList
OperatorToObservableList()
-
-
Method Details
-
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
- Specified by:
call
in interfaceFunc1<Subscriber<? super List<T>>,
Subscriber<? super T>>
-