Class OperatorDistinct<T,​U>

  • Type Parameters:
    T - the value type
    U - the key type
    All Implemented Interfaces:
    Func1<Subscriber<? super T>,​Subscriber<? super T>>, Function, Observable.Operator<T,​T>

    public final class OperatorDistinct<T,​U>
    extends java.lang.Object
    implements Observable.Operator<T,​T>
    Returns an Observable that emits all distinct items emitted by the source.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      (package private) static class  OperatorDistinct.Holder  
    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) Func1<? super T,​? extends U> keySelector  
    • Constructor Summary

      Constructors 
      Constructor Description
      OperatorDistinct​(Func1<? super T,​? extends U> keySelector)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Subscriber<? super T> call​(Subscriber<? super T> child)  
      static <T> OperatorDistinct<T,​T> instance()
      Returns a singleton instance of OperatorDistinct that was built using the identity function for comparison (new OperatorDistinct(UtilityFunctions.identity())).
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • keySelector

        final Func1<? super T,​? extends U> keySelector
    • Constructor Detail

      • OperatorDistinct

        public OperatorDistinct​(Func1<? super T,​? extends U> keySelector)
    • Method Detail

      • instance

        public static <T> OperatorDistinct<T,​T> instance()
        Returns a singleton instance of OperatorDistinct that was built using the identity function for comparison (new OperatorDistinct(UtilityFunctions.identity())).
        Type Parameters:
        T - the value type
        Returns:
        Operator that emits distinct values only (regardless of order) using the identity function for comparison