Class ForeachContext
java.lang.Object
edu.tufts.hrilab.action.execution.Context
edu.tufts.hrilab.action.execution.ArgumentBasedContext
edu.tufts.hrilab.action.execution.control.ForeachContext
This represents the semantics of the FOR EACH control in an action script.
Provides a compact way to iterate over a collection.
-
Field Summary
Fields inherited from class edu.tufts.hrilab.action.execution.ArgumentBasedContext
arguments, variable
Fields inherited from class edu.tufts.hrilab.action.execution.Context
caller, childContexts, cmd, constraints, endTime, log, maxTime, startTime, stateMachine
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondeep copy of the context, its status, and its childrenprotected void
This resets fields specific to concrete sub-classes and should be overridden by inheriting classes if additional resetting needs to happen.protected void
setupArguments
(List<? extends Object> inputArgs, List<? extends Object> returnArgs) Sets up the variable for the "foreach" context.protected void
If Context can have next steps (i.e., children), implement this method to add the next child context that should be executed.Methods inherited from class edu.tufts.hrilab.action.execution.ArgumentBasedContext
addArgument, addArgument, bindPredicate, bindText, copyArguments, getArgument, getArguments, getArgumentSilent, getArgumentType, getArgumentValue, getEvaluatedArgument, getLocalArgument, getSignatureInPredicateForm, hasArgumentInScope, hasLocalArgument, redistributeArguments, setArgument
Methods inherited from class edu.tufts.hrilab.action.execution.Context
acquireLocks, addEvent, addEvent, addEvent, causedFailure, copyInternal, createSimulatedEquivalent, doStep, getActor, getActualLogicalValue, getChildContexts, getCommand, getConstraints, getContextDescription, getContextDescription, getDuration, getElapsedTime, getEndTime, getEquivalentContext, getExecType, getId, getJustification, getLogicalValue, getMaxTime, getNearestTerminatedAncestor, getNextStep, getNextStepForType, getParentContext, getRootContext, getStartTime, getStateMachine, getStateUpdates, getStatus, hasNormCheckingAncestor, isAction, isApproved, isAsynchronous, isFailure, isSimulation, isSuccess, isTerminated, performAdditionalStatusUpdates, releaseLocks, resetContext, resetCoreContext, setChildContexts, setConstraints, setEndTime, setExecType, setLogicalValue, setStartTime, setStartTime, setStateMachine, setStatus, setStatus, setTimeout, setupNextStep, startOverAllMonitor, toString, updatePerformanceModels, verifyEffects, verifyReturnValue, waitForTermination, waitForTermination
-
Constructor Details
-
ForeachContext
-
-
Method Details
-
setupNextStep
protected void setupNextStep()Description copied from class:Context
If Context can have next steps (i.e., children), implement this method to add the next child context that should be executed.- Overrides:
setupNextStep
in classContext
-
setupArguments
Sets up the variable for the "foreach" context.- Specified by:
setupArguments
in classArgumentBasedContext
- Parameters:
inputArgs
- should be 2 arguments: element and collection
-
resetConcreteContext
protected void resetConcreteContext()Description copied from class:Context
This resets fields specific to concrete sub-classes and should be overridden by inheriting classes if additional resetting needs to happen.- Overrides:
resetConcreteContext
in classContext
-
copy
Description copied from class:Context
deep copy of the context, its status, and its children
-