public abstract class AbstractTask extends SimplePropertyObject implements IObjectTask
Modifier and Type | Field and Description |
---|---|
static String |
PROPERTY_CONDITION
The task condition property.
|
PROPERTY_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, toString
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
getProperty, getPropertyNames, hasProperty, setProperty
public static final String PROPERTY_CONDITION
public void start(ISpaceObject obj)
start
in interface IObjectTask
space
- The environment in which the task is executing.obj
- The object that is executing the task.public void shutdown(ISpaceObject obj)
shutdown
in interface IObjectTask
space
- 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 IObjectTask
space
- 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 IObjectTask
public 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.Copyright © 2012. All Rights Reserved.