RxJava



rx.operators
Class OperationDistinctUntilChanged

java.lang.Object
  extended by rx.operators.OperationDistinctUntilChanged

public final class OperationDistinctUntilChanged
extends java.lang.Object

Returns an Observable that emits all sequentially distinct items emitted by the source.


Constructor Summary
OperationDistinctUntilChanged()
           
 
Method Summary
static
<T> Observable.OnSubscribeFunc<T>
distinctUntilChanged(Observable<? extends T> source)
          Returns an Observable that emits all sequentially distinct items emitted by the source.
static
<T> Observable.OnSubscribeFunc<T>
distinctUntilChanged(Observable<? extends T> source, java.util.Comparator<T> equalityComparator)
          Returns an Observable that emits all sequentially distinct items emitted by the source.
static
<T,U> Observable.OnSubscribeFunc<T>
distinctUntilChanged(Observable<? extends T> source, Func1<? super T,? extends U> keySelector)
          Returns an Observable that emits all sequentially distinct items emitted by the source.
static
<T,U> Observable.OnSubscribeFunc<T>
distinctUntilChanged(Observable<? extends T> source, Func1<? super T,? extends U> keySelector, java.util.Comparator<U> equalityComparator)
          Returns an Observable that emits all sequentially distinct items emitted by the source.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OperationDistinctUntilChanged

public OperationDistinctUntilChanged()
Method Detail

distinctUntilChanged

public static <T> Observable.OnSubscribeFunc<T> distinctUntilChanged(Observable<? extends T> source,
                                                                     java.util.Comparator<T> equalityComparator)
Returns an Observable that emits all sequentially distinct items emitted by the source.

Parameters:
source - The source Observable to emit the sequentially distinct items for.
equalityComparator - The comparator to use for deciding whether to consider two items as equal or not.
Returns:
A subscription function for creating the target Observable.

distinctUntilChanged

public static <T,U> Observable.OnSubscribeFunc<T> distinctUntilChanged(Observable<? extends T> source,
                                                                       Func1<? super T,? extends U> keySelector,
                                                                       java.util.Comparator<U> equalityComparator)
Returns an Observable that emits all sequentially distinct items emitted by the source.

Parameters:
source - The source Observable to emit the sequentially distinct items for.
keySelector - The function to select the key to use for the equality checks.
equalityComparator - The comparator to use for deciding whether to consider the two item keys as equal or not.
Returns:
A subscription function for creating the target Observable.

distinctUntilChanged

public static <T,U> Observable.OnSubscribeFunc<T> distinctUntilChanged(Observable<? extends T> source,
                                                                       Func1<? super T,? extends U> keySelector)
Returns an Observable that emits all sequentially distinct items emitted by the source.

Parameters:
source - The source Observable to emit the sequentially distinct items for.
keySelector - The function to select the key to use for the equality checks.
Returns:
A subscription function for creating the target Observable.

distinctUntilChanged

public static <T> Observable.OnSubscribeFunc<T> distinctUntilChanged(Observable<? extends T> source)
Returns an Observable that emits all sequentially distinct items emitted by the source.

Parameters:
source - The source Observable to emit the sequentially distinct items for.
Returns:
A subscription function for creating the target Observable.