me.escapeNT.pail.scheduler
Class Scheduler

java.lang.Object
  extended by me.escapeNT.pail.scheduler.Scheduler

public class Scheduler
extends Object

Registers and executes all scheduled tasks.

Author:
escapeNT

Constructor Summary
Scheduler()
           
 
Method Summary
 ScheduledTask getTask(String name)
          Gets a task matching a specified name, or null if it isn't found.
static HashMap<ScheduledTask,Boolean> getTasks()
          Gets the map of all currently registered tasks and whether they have been executed yet.
static boolean isTaskRegistered(ScheduledTask task)
          Determines if a task has already been registered with the scheduler.
static void loadTasks()
          Loads the saved list of tasks.
static void registerTask(ScheduledTask task)
          Registers a task to be executed.
 void removeTask(String name)
          Removes a task from the list.
static void saveTasks()
          Saves the current list of tasks to file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Scheduler

public Scheduler()
Method Detail

registerTask

public static void registerTask(ScheduledTask task)
Registers a task to be executed. If the task has already been registered, the method simply returns.

Parameters:
task - The task to register.

isTaskRegistered

public static boolean isTaskRegistered(ScheduledTask task)
Determines if a task has already been registered with the scheduler.

Parameters:
task - The task to check.
Returns:
True if it has been registered, false otherwise.

getTasks

public static HashMap<ScheduledTask,Boolean> getTasks()
Gets the map of all currently registered tasks and whether they have been executed yet.

Returns:
The map of tasks to weather or not they have been executed at least once.

saveTasks

public static void saveTasks()
Saves the current list of tasks to file.


loadTasks

public static void loadTasks()
Loads the saved list of tasks.


getTask

public ScheduledTask getTask(String name)
Gets a task matching a specified name, or null if it isn't found.

Parameters:
name - The name of the task.
Returns:
The task with the given name, or null if not found.

removeTask

public void removeTask(String name)
Removes a task from the list.

Parameters:
name -


Copyright © 2011. All Rights Reserved.