Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## schedule
Class Scheduler

    java.lang.Object
      schedule.Scheduler

All Implemented Interfaces:
  IScheduler

    public class Scheduler

extends java.lang.Object
implements IScheduler

Scheduler class is responsible for executing scheduled tasks at right time with correct parameters. Scheduler uses Timer class to perform one time actions repeatedly. After each action Timer is used to schedule execution of another action. Time when Timer is invoked is time of next earliest action to run.

Method Summary
`void` | `addTask(ITask task)` This method can be used to add new tasks into list of tasks scheduler will run.
`void` | `clear()` Cancels timer and clears list of tasks.
`static Scheduler` | `getScheduler()` Returns instance of Scheduler.
`void` | `reschedule()` This method can be used to reset timer after loading new tasks.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Method Detail

### getScheduler

    public static Scheduler getScheduler()

  Returns instance of Scheduler. If no scheduler exists, new is created. Only one scheduler is permitted to exists at one time.

  Returns:
    instance of Scheduler

### reschedule

    public void reschedule()

  This method can be used to reset timer after loading new tasks. Under normal circumstances timer would not take new tasks into account. If timer is scheduled to run at certain time and new task, which should run before timer is invoked, is added, task will be skipped and will run at next opportunity.

  Specified by:
    `reschedule` in interface `IScheduler`

### clear

    public void clear()

  Cancels timer and clears list of tasks.

  Specified by:
    `clear` in interface `IScheduler`

### addTask

    public void addTask(ITask task)

  This method can be used to add new tasks into list of tasks scheduler will run.

  Specified by:
    `addTask` in interface `IScheduler`
  Parameters:
    `task` - class implementing ITask interface that is to be run as certain time

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD