Class DefaultActionFactory

java.lang.Object
repast.simphony.engine.schedule.DefaultActionFactory
All Implemented Interfaces:
IActionFactory

public class DefaultActionFactory extends Object implements IActionFactory
Default factory for producing IActions to be executed by a Schedule.
Version:
$Revision: 1.1 $ $Date: 2005/12/21 22:25:34 $
Author:
Nick Collier
See Also:
  • Constructor Details

    • DefaultActionFactory

      public DefaultActionFactory()
  • Method Details

    • createAction

      public IAction createAction(IAction action)
      Creates an IAction to execute the specified IAction. This default implementation simply returns the parameter.
      Specified by:
      createAction in interface IActionFactory
      Parameters:
      action - the IAction that the created IAction will execute
      Returns:
      the created IAction
    • createAction

      public IAction createAction(Object target, String methodName, Object... parameters)
      Creates an IAction that will call the named method on the specified target using the specified parameters.
      Specified by:
      createAction in interface IActionFactory
      Parameters:
      target - the object on which to call the name method
      methodName - the name of the method to call
      parameters - the parameters of the method
      Returns:
      an IAction that will call the named method on the specified target using the specified parameters.
    • createActionForIterable

      public IAction createActionForIterable(Iterable target, String methodName, boolean shuffle, Object... parameters)
      Creates an IAction that will call the named method on each object in the specified target using the specified parameters.
      Specified by:
      createActionForIterable in interface IActionFactory
      Parameters:
      target - the object on which to call the name method
      methodName - the name of the method to call
      shuffle - whether to shuffle the items in the iterable before calling the method on the objects therein
      parameters - the parameters of the method
      Returns:
      an IAction that will call the named method on the specified target using the specified parameters.
    • createAction

      public IActionParameterPair createAction(Object annotatedObj, Object... parameters)
      Creates an IActionParameterPair from annotated methods in the specified annotatedObj. The IAction will execute the method whose parameters best match the specified parameters. The parameters will be passed to the method at execution.
      Specified by:
      createAction in interface IActionFactory
      Parameters:
      annotatedObj - the object containing the annotated methods
      parameters - the parameters to pass to the method call and to use to find the method itself
      Returns:
      an IActionParameterPair containing the best matching IAction and its ScheduleParameters.
      See Also:
    • createActions

      public List<IActionParameterPair> createActions(Object obj)
      Creates a List of IActionParameterPair-s from annotated methods. The list is created from the methods in the specified object that are annotated by the ScheduledMethod annotation.
      Specified by:
      createActions in interface IActionFactory
      Parameters:
      obj - the object whose methods are annotated
      Returns:
      a List of IAction together with their scheduling parameter data created from annotated methods.
      See Also: