Class DatabaseEntryContext<T extends DBEntry>
java.lang.Object
edu.tufts.hrilab.action.execution.Context
edu.tufts.hrilab.action.execution.ArgumentBasedContext
edu.tufts.hrilab.action.execution.DatabaseEntryContext<T>
- Direct Known Subclasses:
ActionContext,OperatorContext
-
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
ConstructorsModifierConstructorDescriptionprotectedDatabaseEntryContext(Context caller, StateMachine sm, T dbentry) protectedDatabaseEntryContext(Context caller, StateMachine sm, T dbentry, ExecutionType executionType) -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanaddArgument(int roleIndex, Object value) Add an argument to the list of arguments that were passed when the script was invoked.protected booleanaddVarArgArgument(int roleIndex, Object value, int varArgCount) Add a varArg argument to the Context, using the DBEntry role as a guide to populate the argument details.Collect arguments (not local vars) in the correct order to be passed into the primitive action method.getDBE()Create predicate from the context signature.protected voidsetArgument(int pos, Object val) Specify the (deep) value of an argumentbooleanprotected voidsetupArguments(List<? extends Object> inputArgs, List<? extends Object> returnArgs) Goes through and binds the values in an event spec to arguments.protected voidsetupArguments(Map<String, Object> bindings) Goes through and binds the values in an event spec to arguments.Methods inherited from class edu.tufts.hrilab.action.execution.ArgumentBasedContext
addArgument, addArgument, bindPredicate, bindText, copyArguments, getArgument, getArguments, getArgumentSilent, getArgumentType, getArgumentValue, getEvaluatedArgument, getLocalArgument, hasArgumentInScope, hasLocalArgument, redistributeArguments, setArgumentMethods inherited from class edu.tufts.hrilab.action.execution.Context
acquireLocks, addEvent, addEvent, addEvent, causedFailure, copy, 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, resetConcreteContext, resetContext, resetCoreContext, setChildContexts, setConstraints, setEndTime, setExecType, setLogicalValue, setStartTime, setStartTime, setStateMachine, setStatus, setStatus, setTimeout, setupNextStep, setupNextStep, startOverAllMonitor, toString, updatePerformanceModels, verifyEffects, verifyReturnValue, waitForTermination, waitForTermination
-
Constructor Details
-
DatabaseEntryContext
-
DatabaseEntryContext
protected DatabaseEntryContext(Context caller, StateMachine sm, T dbentry, ExecutionType executionType)
-
-
Method Details
-
getSignatureInPredicateForm
Create predicate from the context signature.- Overrides:
getSignatureInPredicateFormin classArgumentBasedContext- Returns:
-
getDBE
- Returns:
- the DB Entry used in this context.
-
setDBE
- Parameters:
dbe- DB Entry to be used in this context.- Returns:
- true if successfully set dbe otherwise false
-
addArgument
Add an argument to the list of arguments that were passed when the script was invoked.- Parameters:
roleIndex- the position at which to add the argumentvalue- the value to be assigned to the argument- Returns:
- true if successful, false otherwise
-
addVarArgArgument
Add a varArg argument to the Context, using the DBEntry role as a guide to populate the argument details.- Parameters:
roleIndex-value-varArgCount-- Returns:
-
setArgument
Specify the (deep) value of an argument- Parameters:
pos- the position at which to add the argumentval- the value to which the argument should be bound
-
setupArguments
Goes through and binds the values in an event spec to arguments. -
setupArguments
Goes through and binds the values in an event spec to arguments. Interprets each element according to its role.- Specified by:
setupArgumentsin classArgumentBasedContext
-
collectArguments
Collect arguments (not local vars) in the correct order to be passed into the primitive action method. This should only return the required args of primitive and return arg- Returns:
- ordered primitive action arguments
-