edu.memphis.ccrg.lida.framework.tasks
Class MockTaskManager
java.lang.Object
edu.memphis.ccrg.lida.framework.tasks.TaskManager
edu.memphis.ccrg.lida.framework.tasks.MockTaskManager
- All Implemented Interfaces:
- GuiEventProvider
public class MockTaskManager
- extends TaskManager
Method Summary |
boolean |
cancelTask(FrameworkTask task)
Cancels the task from the Task Queue. |
boolean |
scheduleTask(FrameworkTask task,
long inXTicks)
Schedules the task for execution in currentTick + inXTicks If inXTicks is
negative or 0, the task is not scheduled. |
Methods inherited from class edu.memphis.ccrg.lida.framework.tasks.TaskManager |
addFrameworkGuiEventListener, addTicksToExecute, getCurrentTick, getEndOfNextInterval, getGuiEventsInterval, getMaxTick, getTaskQueue, getTickDuration, isInIntervalMode, isTasksPaused, pauseTasks, reset, resumeTasks, sendEventToGui, setDecayingModules, setGuiEventsInterval, setInIntervalMode, setTickDuration, stopRunning, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
task
public FrameworkTask task
cancelTask
public FrameworkTask cancelTask
ticks
public long ticks
tasks
public java.util.List<FrameworkTask> tasks
MockTaskManager
public MockTaskManager(int tickDuration,
int maxPoolSize)
scheduleTask
public boolean scheduleTask(FrameworkTask task,
long inXTicks)
- Description copied from class:
TaskManager
- Schedules the task for execution in currentTick + inXTicks If inXTicks is
negative or 0, the task is not scheduled.
- Overrides:
scheduleTask
in class TaskManager
- Parameters:
task
- the task to scheduleinXTicks
- the number of ticks in the future that the task will be
scheduled for execution.
- Returns:
- true if the task was scheduled.
cancelTask
public boolean cancelTask(FrameworkTask task)
- Description copied from class:
TaskManager
- Cancels the task from the Task Queue. This is only possible if the tick
for which the task is scheduled has not been reached.
- Overrides:
cancelTask
in class TaskManager
- Parameters:
task
- The task to cancel.
- Returns:
- true if it was , false otherwise.