Package 

Class Repeater


  • 
    public class Repeater
    
                        

    A method repeater to easily perform update functions on a timed basis. NOTE: the duration between repeats may not be exact. If you require an exact amount of elapsed time use the StopWatch instead.

    • Method Summary

      Modifier and Type Method Description
      int getRepeaterDelay() Retrieves the amount of time between method invocation.
      void setRepeaterDelay(int milliSeconds) Sets the amount of time between method invocation.
      void start() Starts the repeater
      void stop() Stops the repeater
      boolean isRunning() Determines if the Repeater is currently running
      void setRepeatListener(Repeater.RepeatListener listener) Sets the listener to be notified for each repeat
      • Methods inherited from class java.lang.Object

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

      • Repeater

        Repeater()
      • Repeater

        Repeater(boolean processOnStartingThread)
        Parameters:
        processOnStartingThread - True if the repeating process should be handled on the same thread that created the Repeater
      • Repeater

        Repeater(Handler handler)
        Parameters:
        handler - The Handler to use for the repeating process
    • Method Detail

      • getRepeaterDelay

         int getRepeaterDelay()

        Retrieves the amount of time between method invocation.

      • setRepeaterDelay

         void setRepeaterDelay(int milliSeconds)

        Sets the amount of time between method invocation.

        Parameters:
        milliSeconds - The time between method calls [default: {@value #DEFAULT_REPEAT_DELAY}]
      • start

         void start()

        Starts the repeater

      • stop

         void stop()

        Stops the repeater

      • isRunning

         boolean isRunning()

        Determines if the Repeater is currently running