Package repast.simphony.engine.schedule
Interface IActionFactory
- All Known Implementing Classes:
DefaultActionFactory
public interface IActionFactory
Factory for producing IActions to be executed by a Schedule.
-
Method Summary
Modifier and TypeMethodDescriptioncreateAction
(Object annotatedObj, Object... parameters) Creates an IActionParameterPair from annotated methods in the specified annotatedObj.createAction
(Object target, String methodName, Object... parameters) Creates an IAction that will call the named method on the specified target using the specified parameters.createAction
(IAction action) Creates an IAction to execute the specified 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.createActions
(Object obj) Creates a List of IActionParameterPair-s from annotated methods.
-
Method Details
-
createAction
Creates an IAction to execute the specified IAction. It is acceptable to return the passed in IAction, if no other wrapping or decoration is necessary.- Parameters:
action
- the IAction that the created IAction will execute- Returns:
- the created IAction
-
createAction
Creates an IAction that will call the named method on the specified target using the specified parameters.- Parameters:
target
- the object on which to call the name methodmethodName
- the name of the method to callparameters
- the parameters of the method- Returns:
- an IAction that will call the named method on the specified target using the specified parameters.
-
createActionForIterable
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.- Parameters:
target
- the object on which to call the name methodmethodName
- the name of the method to callshuffle
- whether to shuffle the items in the iterable before calling the method on the objects thereinparameters
- the parameters of the method- Returns:
- an IAction that will call the named method on the specified target using the specified parameters.
-
createAction
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.- Parameters:
annotatedObj
- the object containing the annotated methodsparameters
- 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
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.- 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:
-