edu.washington.cs.supple.customization.command
Class CommandReversals

java.lang.Object
  extended byedu.washington.cs.supple.customization.command.CommandReversals
All Implemented Interfaces:
Command

public class CommandReversals
extends java.lang.Object
implements Command

The reversal of another command. The reversal could actually cause several individual action reversals. For example, if the the command to be reversed was a generalization, several reversals are performed.

Author:
raphael

Constructor Summary
CommandReversals(Command command)
           
 
Method Summary
 boolean equals(Command c)
          Compares this command to another command.
 void execute(State s)
          Executes the command on a given UI.
 void execute(State s, Specification spec)
          Applies a command only to a part of a UI.
 Action getAction()
          Returns the action type used by the command.
 java.lang.String toString()
          A string representation of the command.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CommandReversals

public CommandReversals(Command command)
Method Detail

execute

public void execute(State s)
             throws ConditionViolationException
Description copied from interface: Command
Executes the command on a given UI. If the execution succeeds, the state is updated - i.e. the functional spec changes and the history records are added to the history list.

Specified by:
execute in interface Command
Parameters:
s - state of UI
Throws:
ConditionViolationException

execute

public void execute(State s,
                    Specification spec)
             throws ConditionViolationException
Description copied from interface: Command
Applies a command only to a part of a UI.

Specified by:
execute in interface Command
Parameters:
s - state of UI
spec - part of the UI where command is applied
Throws:
ConditionViolationException

getAction

public Action getAction()
Description copied from interface: Command
Returns the action type used by the command. A standard command performs this action at one location of the UI, a generalization command performs this action at several locations of the UI.

Specified by:
getAction in interface Command
Returns:
action

equals

public boolean equals(Command c)
Description copied from interface: Command
Compares this command to another command. The scopes are not being compared, but only the command itself. For instance, if they are both set default commands, then the default values have to match, but not the scopes.

Specified by:
equals in interface Command
Parameters:
c - another command to compare this one to

toString

public java.lang.String toString()
Description copied from interface: Command
A string representation of the command.

Specified by:
toString in interface Command