Class AnalyzeTargetTask
- java.lang.Object
-
- jadex.commons.SimplePropertyObject
-
- jadex.extension.envsupport.environment.AbstractTask
-
- jadex.bdiv3.examples.marsworld.sentry.AnalyzeTargetTask
-
- All Implemented Interfaces:
jadex.commons.IPropertyObject
,jadex.extension.envsupport.environment.IObjectTask
public class AnalyzeTargetTask extends jadex.extension.envsupport.environment.AbstractTask
Analyze a given target.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
PROPERTY_ORE
The property for the ore amount.static java.lang.String
PROPERTY_STATE
The state for targets (unknown, analyzing, analyzed).static java.lang.String
PROPERTY_TARGET
The property for the target.static java.lang.String
PROPERTY_TYPENAME
The type name property.static java.lang.String
STATE_ANALYZED
The unknown state for target.static java.lang.String
STATE_ANALYZING
The unknown state for target.static java.lang.String
STATE_UNKNOWN
The unknown state for target.protected jadex.extension.envsupport.environment.ISpaceObject
target
The target.protected int
time
The remaining time.static int
TIME
The time required for analyzing a target (in millis).
-
Constructor Summary
Constructors Constructor Description AnalyzeTargetTask()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
execute(jadex.extension.envsupport.environment.IEnvironmentSpace space, jadex.extension.envsupport.environment.ISpaceObject obj, long progress, jadex.bridge.service.types.clock.IClockService clock)
Executes the task.void
start(jadex.extension.envsupport.environment.ISpaceObject obj)
This method will be executed by the object before the task gets added to the execution queue.-
Methods inherited from class jadex.extension.envsupport.environment.AbstractTask
isFinished, setFinished, shutdown
-
Methods inherited from class jadex.commons.SimplePropertyObject
addPropertyChangeListener, getProperties, getProperty, getPropertyNames, hasProperty, removePropertyChangeListener, setProperties, setProperty, toString
-
-
-
-
Field Detail
-
PROPERTY_TYPENAME
public static final java.lang.String PROPERTY_TYPENAME
The type name property.- See Also:
- Constant Field Values
-
PROPERTY_TARGET
public static final java.lang.String PROPERTY_TARGET
The property for the target.- See Also:
- Constant Field Values
-
PROPERTY_STATE
public static final java.lang.String PROPERTY_STATE
The state for targets (unknown, analyzing, analyzed).- See Also:
- Constant Field Values
-
STATE_UNKNOWN
public static final java.lang.String STATE_UNKNOWN
The unknown state for target.- See Also:
- Constant Field Values
-
STATE_ANALYZING
public static final java.lang.String STATE_ANALYZING
The unknown state for target.- See Also:
- Constant Field Values
-
STATE_ANALYZED
public static final java.lang.String STATE_ANALYZED
The unknown state for target.- See Also:
- Constant Field Values
-
PROPERTY_ORE
public static final java.lang.String PROPERTY_ORE
The property for the ore amount.- See Also:
- Constant Field Values
-
TIME
public static final int TIME
The time required for analyzing a target (in millis).- See Also:
- Constant Field Values
-
target
protected jadex.extension.envsupport.environment.ISpaceObject target
The target.
-
time
protected int time
The remaining time.
-
-
Method Detail
-
start
public void start(jadex.extension.envsupport.environment.ISpaceObject obj)
This method will be executed by the object before the task gets added to the execution queue.- Specified by:
start
in interfacejadex.extension.envsupport.environment.IObjectTask
- Overrides:
start
in classjadex.extension.envsupport.environment.AbstractTask
- Parameters:
obj
- The object that is executing the task.
-
execute
public void execute(jadex.extension.envsupport.environment.IEnvironmentSpace space, jadex.extension.envsupport.environment.ISpaceObject obj, long progress, jadex.bridge.service.types.clock.IClockService clock)
Executes the task. Handles exceptions. Subclasses should implement doExecute() instead.- Specified by:
execute
in interfacejadex.extension.envsupport.environment.IObjectTask
- Overrides:
execute
in classjadex.extension.envsupport.environment.AbstractTask
- 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.
-
-