Interface TimerTask


public interface TimerTask
Result of scheduling a task on a Timer. Allows observing whether the task is done and cancelling the task.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Requests cancellation of this task.
    boolean
    Returns whether this task is done.
  • Method Details

    • isDone

      boolean isDone()
      Returns whether this task is done. A task is done if it has already finished or was successfully cancelled.
      Returns:
      whether this task is done
    • cancel

      boolean cancel()
      Requests cancellation of this task. Task cannot be cancelled when it's already running.
      Returns:
      whether the task was successfully cancelled