Class OperatorDebounceWithTime<T>

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

    public final class OperatorDebounceWithTime<T>
    extends java.lang.Object
    implements Observable.Operator<T,​T>
    This operation filters out events which are published too quickly in succession. This is done by dropping events which are followed up by other events before a specified timer has expired. If the timer expires and no follow up event was published (yet) the last received event is published.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      (package private) static class  OperatorDebounceWithTime.DebounceState<T>
      Tracks the last value to be emitted and manages completion.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) Scheduler scheduler  
      (package private) long timeout  
      (package private) java.util.concurrent.TimeUnit unit  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Subscriber<? super T> call​(Subscriber<? super T> child)  
      • Methods inherited from class java.lang.Object

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

      • timeout

        final long timeout
      • unit

        final java.util.concurrent.TimeUnit unit
    • Constructor Detail

      • OperatorDebounceWithTime

        public OperatorDebounceWithTime​(long timeout,
                                        java.util.concurrent.TimeUnit unit,
                                        Scheduler scheduler)
        Parameters:
        timeout - How long each event has to be the 'last event' before it gets published.
        unit - The unit of time for the specified timeout.
        scheduler - The Scheduler to use internally to manage the timers which handle timeout for each event.