Class ReturnContext

java.lang.Object
edu.tufts.hrilab.action.execution.Context
edu.tufts.hrilab.action.execution.control.ReturnContext

public class ReturnContext extends Context
This is used to explicitly return from an action script early, just as you would from Java. Here, the exit will only propagate up the context tree until an action script or asynchronous context is encountered. This scoping is similar to Java in that a return only returns from a Java method.
  • Constructor Details

  • Method Details

    • doStep

      public void doStep()
      Description copied from class: Context
      If Context has a concrete execution step to perform, it should happen in this method. This should not include setting up next steps (i.e., children to perform), which should happen in the setupNextStep method. Primitive actions and operators (i.e., leaf nodes in the context tree) are examples where this method should be implemented.
      Overrides:
      doStep in class Context
    • getNextStepForType

      protected Context getNextStepForType()
      Description copied from class: Context
      Get the next step (i.e., context) to be executed. Returns null if there are no more steps. TODO: remove this method
      Overrides:
      getNextStepForType in class Context
      Returns:
    • copy

      public ReturnContext copy(Context newParent)
      Description copied from class: Context
      deep copy of the context, its status, and its children
      Specified by:
      copy in class Context
      Parameters:
      newParent - parent to attach the copied context too
      Returns:
      the copied context