RxJava
rx.operators
Class OperationToObservableSortedList<T>
java.lang.Object
rx.operators.OperationToObservableSortedList<T>
- Type Parameters:
T -
public final class OperationToObservableSortedList<T>
- extends java.lang.Object
Return an Observable that emits the items emitted by the source Observable, in a sorted order
(each item emitted by the Observable must implement Comparable with respect to all other items
in the sequence, or you must pass in a sort function).
|
Method Summary |
static
|
toSortedList(Observable<? extends T> sequence)
Sort T objects by their natural order (object must implement Comparable). |
static
|
toSortedList(Observable<? extends T> sequence,
Func2<? super T,? super T,java.lang.Integer> sortFunction)
Sort T objects using the defined sort function. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
OperationToObservableSortedList
public OperationToObservableSortedList()
toSortedList
public static <T> Observable.OnSubscribeFunc<java.util.List<T>> toSortedList(Observable<? extends T> sequence)
- Sort T objects by their natural order (object must implement Comparable).
- Parameters:
sequence -
- Returns:
- an observable containing the sorted list
- Throws:
java.lang.ClassCastException - if T objects do not implement Comparable
toSortedList
public static <T> Observable.OnSubscribeFunc<java.util.List<T>> toSortedList(Observable<? extends T> sequence,
Func2<? super T,? super T,java.lang.Integer> sortFunction)
- Sort T objects using the defined sort function.
- Parameters:
sequence - sortFunction -
- Returns:
- an observable containing the sorted list