Class AbstractControllerAction<T>

java.lang.Object
repast.simphony.engine.controller.AbstractControllerAction<T>
All Implemented Interfaces:
ControllerAction
Direct Known Subclasses:
NullAbstractControllerAction

public abstract class AbstractControllerAction<T> extends Object implements ControllerAction
An abstract ControllerAction that aims to simplify the implementation of ControllerActions. This class searches the RunState
Version:
$Revision: 1.1 $ $Date: 2005/12/21 22:25:34 $
Author:
Jerry Vos
  • Constructor Details

    • AbstractControllerAction

      public AbstractControllerAction()
  • Method Details

    • batchInitialize

      public void batchInitialize(RunState runState, Object contextId)
      Default empty implementation of this method that performs no action. If a subclass should perform batch initialization override this method.
      Specified by:
      batchInitialize in interface ControllerAction
      Parameters:
      runState - the runState used for the action
      contextId - the id used for finding the context
    • runInitialize

      public void runInitialize(RunState runState, Object contextId, Parameters runParams)
      This delegates to #runInitialize(RunState, Context) after finding the context with the given contextId.

      This is the same as runInitialize(runState, findContextInRunState(runState, contextId));

      Specified by:
      runInitialize in interface ControllerAction
      Parameters:
      runState - the runState used for the action
      contextId - the id used for finding the context
      runParams - the current run's parameters
    • runCleanup

      public void runCleanup(RunState runState, Object contextId)
      This delegates to runCleanup(RunState, Context) after finding the context with the given contextId.

      This is the same as runCleanup(runState, findContextInRunState(runState, contextId));

      Specified by:
      runCleanup in interface ControllerAction
      Parameters:
      runState - the runState used for the action
      contextId - the id used for finding the context
    • batchCleanup

      public void batchCleanup(RunState runState, Object contextId)
      This performs no action.
      Specified by:
      batchCleanup in interface ControllerAction
      Parameters:
      runState - the runState used for the action
      contextId - the id used for finding the context
    • runInitialize

      public abstract void runInitialize(RunState runState, Context<? extends T> context, Parameters runParams)
    • runCleanup

      public abstract void runCleanup(RunState runState, Context<? extends T> context)
    • findContextInRunState

      public static Context findContextInRunState(RunState runState, Object contextId)
    • accept

      public void accept(ControllerActionVisitor visitor)
      Accepts the specified visitor. This calls the default visit method.
      Parameters:
      visitor - the visitor to accept