vitro
Class CompositeAction

java.lang.Object
  extended by vitro.CompositeAction
All Implemented Interfaces:
Action

public class CompositeAction
extends Object
implements Action

A CompositeAction offers an easy way to carry out several existing Actions in sequence as an atomic operation. Component Actions will be applied in the order given, and rolled back in reverse order.


Field Summary
 List<Action> actions
           
 
Constructor Summary
CompositeAction(Action... actions)
          An alternate vararg-based constructor.
CompositeAction(List<Action> actions)
          Create a new CompositeAction from a list of Actions.
 
Method Summary
 void apply()
          Apply this Action's change to a supplied Model or Models.
 boolean equals(Object o)
          
 int hashCode()
          
 String toString()
          
 void undo()
          Revert any changes made during apply().
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

actions

public final List<Action> actions
Constructor Detail

CompositeAction

public CompositeAction(List<Action> actions)
Create a new CompositeAction from a list of Actions.

Parameters:
actions - the List of Actions to perform.

CompositeAction

public CompositeAction(Action... actions)
An alternate vararg-based constructor.

Parameters:
actions - a sequence of Actions to perform.
Method Detail

apply

public void apply()
Apply this Action's change to a supplied Model or Models.

Specified by:
apply in interface Action

undo

public void undo()
Revert any changes made during apply().

Specified by:
undo in interface Action

hashCode

public int hashCode()

Overrides:
hashCode in class Object

equals

public boolean equals(Object o)

Overrides:
equals in class Object

toString

public String toString()

Overrides:
toString in class Object