Class Debouncer


  • public class Debouncer
    extends Object
    Postpones a operation until a configurable amount of time is passed without further requests for the operation.
    Since:
    1.0.0
    • Constructor Detail

      • Debouncer

        public Debouncer​(int interval,
                         Runnable runnable)
        Creates a new Debouncer.
        Parameters:
        interval - the interval to wait for new calls.
        runnable - the task to execute
    • Method Detail

      • call

        public void call()
        Request the execution of the operation.
      • finish

        public void finish()
        Shut this Debouncer down by executing any pending request. Note: further calls to this class are undefined.