Package edu.tufts.hrilab.navigation
Class NavigationAction
java.lang.Object
edu.tufts.hrilab.navigation.NavigationAction
- All Implemented Interfaces:
Runnable
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionNavigationAction
(NavigationAction.ActionType t, double[] args) NavigationAction
(NavigationAction.ActionType t, long[] args) NavigationAction
(NavigationAction.ActionType t, String[] args) -
Method Summary
Modifier and TypeMethodDescriptionabstract boolean
cancel()
Main action cancellation method to be implemented.long
getID()
ID of action.boolean
Run flag status.Get action status.abstract void
run()
Main run method to be implemented.void
setRunFlag
(boolean flag) Set the run flag status.void
Set action status.
-
Field Details
-
type
-
ID
protected final long ID -
dargs
protected double[] dargs -
stargs
-
largs
protected long[] largs
-
-
Constructor Details
-
Method Details
-
getStatus
Get action status.- Returns:
-
setStatus
Set action status. -
getID
public long getID()ID of action.- Returns:
- - timestamp when action was created.
-
setRunFlag
public void setRunFlag(boolean flag) Set the run flag status. Use this to end processing of a run loop.- Parameters:
flag
-
-
getRunFlag
public boolean getRunFlag()Run flag status. Automatically set to true on object instantiation, and will return true even if action is not currently running. Run methods that continually loop should use this method to know if the loop should terminate.- Returns:
- boolean - runFlag
-
run
public abstract void run()Main run method to be implemented. This is the method ran by the NavigationActionManager once a NavigationAction instance is submitted to the manager via initiateAction. -
cancel
public abstract boolean cancel()Main action cancellation method to be implemented. This method cancels the processing of the run method if this instance is currently being ran by a NavigationActionManager.- Returns:
- - if Action was currently being ran by manager.
-