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, variableFields 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 voidThis resets fields specific to concrete sub-classes and should be overridden by inheriting classes if additional resetting needs to happen.protected voidsetupArguments(List<? extends Object> inputArgs, List<? extends Object> returnArgs) Sets up the variable for the "foreach" context.protected voidIf 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, setArgumentMethods 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:ContextIf Context can have next steps (i.e., children), implement this method to add the next child context that should be executed.- Overrides:
setupNextStepin classContext
-
setupArguments
Sets up the variable for the "foreach" context.- Specified by:
setupArgumentsin classArgumentBasedContext- Parameters:
inputArgs- should be 2 arguments: element and collection
-
resetConcreteContext
protected void resetConcreteContext()Description copied from class:ContextThis resets fields specific to concrete sub-classes and should be overridden by inheriting classes if additional resetting needs to happen.- Overrides:
resetConcreteContextin classContext
-
copy
Description copied from class:Contextdeep copy of the context, its status, and its children
-