Interface TimerTask
-
public interface TimerTaskResult of scheduling a task on aTimer. Allows observing whether the task is done and cancelling the task.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleancancel()Requests cancellation of this task.booleanisDone()Returns whether this task is done.
-
-
-
Method Detail
-
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
-
-