edu.memphis.ccrg.lida.framework.tasks
Class MockTaskManager

java.lang.Object
  extended by edu.memphis.ccrg.lida.framework.tasks.TaskManager
      extended by edu.memphis.ccrg.lida.framework.tasks.MockTaskManager
All Implemented Interfaces:
GuiEventProvider

public class MockTaskManager
extends TaskManager


Field Summary
 FrameworkTask cancelTask
           
 FrameworkTask task
           
 java.util.List<FrameworkTask> tasks
           
 long ticks
           
 
Fields inherited from class edu.memphis.ccrg.lida.framework.tasks.TaskManager
DEFAULT_NUMBER_OF_THREADS, DEFAULT_TICK_DURATION
 
Constructor Summary
MockTaskManager(int tickDuration, int maxPoolSize)
           
 
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
 

Field Detail

task

public FrameworkTask task

cancelTask

public FrameworkTask cancelTask

ticks

public long ticks

tasks

public java.util.List<FrameworkTask> tasks
Constructor Detail

MockTaskManager

public MockTaskManager(int tickDuration,
                       int maxPoolSize)
Method Detail

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 schedule
inXTicks - 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.