public class Scheduler
extends java.lang.Object
Constructor and Description |
---|
Scheduler() |
Modifier and Type | Method and Description |
---|---|
static boolean |
schedule(Task task,
long delay,
long period)
Schedules a recurring task.
|
static boolean |
unschedule(Task task)
Removes a task from the scheduler queue.
|
static void |
unscheduleAll()
Removes all tasks from the scheduler queue.
|
public static boolean schedule(Task task, long delay, long period)
task
- the task to rundelay
- the first execution delay (in millis)period
- the waiting period (in millis)public static boolean unschedule(Task task)
task
- the task to removepublic static void unscheduleAll()