Runs a ScheduledTask.
()
| 106 | * Runs a {@link ScheduledTask}. |
| 107 | */ |
| 108 | public static void runTask() { |
| 109 | // If there are any tasks |
| 110 | if (taskQueue.size() > 0) { |
| 111 | // Get the next ScheduledTask |
| 112 | ScheduledTask currentScheduledTask = taskQueue.poll(); |
| 113 | Task currentTask = currentScheduledTask.getTask(); |
| 114 | currentTime = currentScheduledTask.getScheduledTime(); |
| 115 | // Remove the task from the mapping of all tasks |
| 116 | taskMap.remove(currentTask, currentScheduledTask); |
| 117 | // Execute |
| 118 | currentTask.run(); |
| 119 | } |
| 120 | } |
| 121 | |
| 122 | /** |
| 123 | * Remove task from the mapping of all tasks and from the execution queue. |
no test coverage detected