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 abstractControllerAction
that aims to simplify the implementation of ControllerActions. This class searches theRunState
- Version:
- $Revision: 1.1 $ $Date: 2005/12/21 22:25:34 $
- Author:
- Jerry Vos
-
-
Constructor Summary
Constructors Constructor Description AbstractControllerAction()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
accept(ControllerActionVisitor visitor)
Accepts the specified visitor.void
batchCleanup(RunState runState, Object contextId)
This performs no action.void
batchInitialize(RunState runState, Object contextId)
Default empty implementation of this method that performs no action.static Context
findContextInRunState(RunState runState, Object contextId)
void
runCleanup(RunState runState, Object contextId)
This delegates torunCleanup(RunState, Context)
after finding the context with the given contextId.abstract void
runCleanup(RunState runState, Context<? extends T> context)
void
runInitialize(RunState runState, Object contextId, Parameters runParams)
This delegates to#runInitialize(RunState, Context)
after finding the context with the given contextId.abstract void
runInitialize(RunState runState, Context<? extends T> context, Parameters runParams)
-
-
-
Method Detail
-
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 interfaceControllerAction
- Parameters:
runState
- the runState used for the actioncontextId
- 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 asrunInitialize(runState, findContextInRunState(runState, contextId));
- Specified by:
runInitialize
in interfaceControllerAction
- Parameters:
runState
- the runState used for the actioncontextId
- the id used for finding the contextrunParams
- the current run's parameters
-
runCleanup
public void runCleanup(RunState runState, Object contextId)
This delegates torunCleanup(RunState, Context)
after finding the context with the given contextId. This is the same asrunCleanup(runState, findContextInRunState(runState, contextId));
- Specified by:
runCleanup
in interfaceControllerAction
- Parameters:
runState
- the runState used for the actioncontextId
- the id used for finding the context
-
batchCleanup
public void batchCleanup(RunState runState, Object contextId)
This performs no action.- Specified by:
batchCleanup
in interfaceControllerAction
- Parameters:
runState
- the runState used for the actioncontextId
- the id used for finding the context
-
runInitialize
public abstract void runInitialize(RunState runState, Context<? extends T> context, Parameters runParams)
-
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
-
-