public abstract class AbstractTask extends SimplePropertyObject implements IObjectTask
| Modifier and Type | Field and Description | 
|---|---|
| protected IBooleanCondition | conditionThe task condition (optional). | 
| protected boolean | finishedThe finished flag. | 
| static java.lang.String | PROPERTY_CONDITIONThe task condition property. | 
pcs, propertiesPROPERTY_ID| Constructor and Description | 
|---|
| AbstractTask() | 
| Modifier and Type | Method and Description | 
|---|---|
| void | execute(IEnvironmentSpace space,
       ISpaceObject obj,
       long progress,
       IClockService clock)Executes the task. | 
| boolean | isFinished(IEnvironmentSpace space,
          ISpaceObject obj)Check if a task is finished and should be removed. | 
| void | setFinished(IEnvironmentSpace space,
           ISpaceObject obj,
           boolean finished)Indicate that the task is finished and should be removed. | 
| void | shutdown(ISpaceObject obj)This method will be executed by the object before the task is removed
  from the execution queue. | 
| void | start(ISpaceObject obj)This method will be executed by the object before the task gets added to
  the execution queue. | 
addPropertyChangeListener, getProperties, getProperty, getPropertyNames, hasProperty, removePropertyChangeListener, setProperties, setProperty, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetProperty, getPropertyNames, hasProperty, setPropertypublic static final java.lang.String PROPERTY_CONDITION
protected boolean finished
protected IBooleanCondition condition
public void start(ISpaceObject obj)
start in interface IObjectTaskspace - The environment in which the task is executing.obj - The object that is executing the task.public void shutdown(ISpaceObject obj)
shutdown in interface IObjectTaskspace - The environment in which the task is executing.obj - The object that is executing the task.public void execute(IEnvironmentSpace space, ISpaceObject obj, long progress, IClockService clock)
execute in interface IObjectTaskspace - The environment in which the task is executing.obj - The object that is executing the task.progress - The time that has passed according to the environment executor.clock - The clock service.public boolean isFinished(IEnvironmentSpace space, ISpaceObject obj)
isFinished in interface IObjectTaskpublic void setFinished(IEnvironmentSpace space, ISpaceObject obj, boolean finished)
space - The environment in which the task is executing.obj - The object that is executing the task.finished - The finished flag.