Class AbstractTask
- java.lang.Object
- 
- jadex.commons.SimplePropertyObject
- 
- jadex.extension.envsupport.environment.AbstractTask
 
 
- 
- All Implemented Interfaces:
- IPropertyObject,- IObjectTask
 - Direct Known Subclasses:
- AnalyzeTargetTask,- AnalyzeTargetTask,- AnalyzeTargetTask,- ClearChemicalsTask,- ClearChemicalsTask,- DeliverPatientTask,- DeliverPatientTask,- ExtinguishFireTask,- ExtinguishFireTask,- LoadBatteryTask,- LoadOreTask,- LoadOreTask,- LoadOreTask,- Move3DTask,- MoveTask,- MoveTask,- MoveTask,- MoveTask,- MoveTask,- MoveTask,- ProduceOreTask,- ProduceOreTask,- ProduceOreTask,- Rotation3DTask,- RotationTask,- RotationTask,- RotationTask,- TreatVictimTask,- TreatVictimTask
 
 public abstract class AbstractTask extends SimplePropertyObject implements IObjectTask Empty default implementation for object tasks.
- 
- 
Field SummaryFields Modifier and Type Field Description protected IBooleanConditionconditionThe task condition (optional).protected booleanfinishedThe finished flag.static java.lang.StringPROPERTY_CONDITIONThe task condition property.- 
Fields inherited from class jadex.commons.SimplePropertyObjectpcs, properties
 - 
Fields inherited from interface jadex.extension.envsupport.environment.IObjectTaskPROPERTY_ID
 
- 
 - 
Constructor SummaryConstructors Constructor Description AbstractTask()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidexecute(IEnvironmentSpace space, ISpaceObject obj, long progress, IClockService clock)Executes the task.booleanisFinished(IEnvironmentSpace space, ISpaceObject obj)Check if a task is finished and should be removed.voidsetFinished(IEnvironmentSpace space, ISpaceObject obj, boolean finished)Indicate that the task is finished and should be removed.voidshutdown(ISpaceObject obj)This method will be executed by the object before the task is removed from the execution queue.voidstart(ISpaceObject obj)This method will be executed by the object before the task gets added to the execution queue.- 
Methods inherited from class jadex.commons.SimplePropertyObjectaddPropertyChangeListener, getProperties, getProperty, getPropertyNames, hasProperty, removePropertyChangeListener, setProperties, setProperty, toString
 - 
Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 - 
Methods inherited from interface jadex.commons.IPropertyObjectgetProperty, getPropertyNames, hasProperty, setProperty
 
- 
 
- 
- 
- 
Field Detail- 
PROPERTY_CONDITIONpublic static final java.lang.String PROPERTY_CONDITION The task condition property.- See Also:
- Constant Field Values
 
 - 
finishedprotected boolean finished The finished flag.
 - 
conditionprotected IBooleanCondition condition The task condition (optional). Task is executed as long as the condition is true.
 
- 
 - 
Method Detail- 
startpublic void start(ISpaceObject obj) This method will be executed by the object before the task gets added to the execution queue. Empty default implementation that can be replaced by subclasses.- Specified by:
- startin interface- IObjectTask
- Parameters:
- space- The environment in which the task is executing.
- obj- The object that is executing the task.
 
 - 
shutdownpublic void shutdown(ISpaceObject obj) This method will be executed by the object before the task is removed from the execution queue. Notifies the listener and hence should be called when overridden in subclasses.- Specified by:
- shutdownin interface- IObjectTask
- Parameters:
- space- The environment in which the task is executing.
- obj- The object that is executing the task.
 
 - 
executepublic void execute(IEnvironmentSpace space, ISpaceObject obj, long progress, IClockService clock) Executes the task.- Specified by:
- executein interface- IObjectTask
- Parameters:
- 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.
 
 - 
isFinishedpublic boolean isFinished(IEnvironmentSpace space, ISpaceObject obj) Check if a task is finished and should be removed. Finished tasks will no longer be executed.- Specified by:
- isFinishedin interface- IObjectTask
- Returns:
- True, if the task is finished.
 
 - 
setFinishedpublic void setFinished(IEnvironmentSpace space, ISpaceObject obj, boolean finished) Indicate that the task is finished and should be removed.- Parameters:
- space- The environment in which the task is executing.
- obj- The object that is executing the task.
- finished- The finished flag.
 
 
- 
 
-