Interface Timer


  • public interface Timer
    A timer is a handle for a block of code that is scheduled for future execution. A timer can be canceled or rescheduled. The script action "createTimer" returns a Timer instance.
    Author:
    Kai Kreuzer - Initial contribution
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      boolean cancel()
      Cancels the timer
      boolean hasTerminated()
      Determines whether the scheduled execution has already terminated.
      boolean isRunning()
      Determines whether the scheduled code is currently executed.
      boolean reschedule​(org.joda.time.base.AbstractInstant newTime)
      Reschedules a timer to a new starting time.
    • Method Detail

      • cancel

        boolean cancel()
        Cancels the timer
        Returns:
        true, if cancellation was successful
      • isRunning

        boolean isRunning()
        Determines whether the scheduled code is currently executed.
        Returns:
        true, if the code is being executed, false otherwise
      • hasTerminated

        boolean hasTerminated()
        Determines whether the scheduled execution has already terminated.
        Returns:
        true, if the scheduled execution has already terminated, false otherwise
      • reschedule

        boolean reschedule​(org.joda.time.base.AbstractInstant newTime)
        Reschedules a timer to a new starting time. This can also be called after a timer has terminated, which will result in another execution of the same code.
        Parameters:
        newTime - the new time to execute the code
        Returns:
        true, if the rescheduling was done successful