etomica.action
Class ActionGroupSeries

java.lang.Object
  extended by etomica.action.ActionGroupSeries
All Implemented Interfaces:
ActionGroup, IAction, Serializable

public class ActionGroupSeries
extends Object
implements IAction, Serializable, ActionGroup

A set of Action instances grouped and performed in series as if a single action. Actions may be defined at construction and/or added afterward. Actions are performed in the order in which they are specifed in the constructor and subsequently added.

See Also:
Serialized Form

Constructor Summary
ActionGroupSeries()
          Constructs an action group that holds no actions.
ActionGroupSeries(IAction[] actions)
          Defines group via the given array of actions.
 
Method Summary
 void actionPerformed()
          Invokes the actionPerformed method of all actions in the method, in the order given by the array at construction.
 void addAction(IAction newAction)
          Adds the given action to the group.
 IAction[] getAllActions()
          Returns all actions from this group.
 boolean removeAction(IAction oldAction)
          Removes the given action from the group.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ActionGroupSeries

public ActionGroupSeries()
Constructs an action group that holds no actions.


ActionGroupSeries

public ActionGroupSeries(IAction[] actions)
Defines group via the given array of actions. Copy of array is made and used internally.

Method Detail

actionPerformed

public void actionPerformed()
Invokes the actionPerformed method of all actions in the method, in the order given by the array at construction.

Specified by:
actionPerformed in interface IAction

addAction

public void addAction(IAction newAction)
Adds the given action to the group. No check is made of whether action is already in group; it is added regardless.

Specified by:
addAction in interface ActionGroup
Parameters:
newAction -

removeAction

public boolean removeAction(IAction oldAction)
Removes the given action from the group. No warning or error is given if action is not in the group already.

Specified by:
removeAction in interface ActionGroup

getAllActions

public IAction[] getAllActions()
Description copied from interface: ActionGroup
Returns all actions from this group.

Specified by:
getAllActions in interface ActionGroup