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

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

public class CommandSingleReversal
extends java.lang.Object
implements Command

Reverses a command at a single location only. For example, if the given command is a generalization, it may not be entirely reversed, but only at a single location. This type of "single reversal" is used to make a customization plan executable. Only the minimal number of customizations are reversed, such that the plan is executable (all conditions hold).

Author:
raphael

Constructor Summary
CommandSingleReversal(HistoryRecord record)
           
CommandSingleReversal(HistoryRecord record, Command creator)
           
 
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

CommandSingleReversal

public CommandSingleReversal(HistoryRecord record)

CommandSingleReversal

public CommandSingleReversal(HistoryRecord record,
                             Command creator)
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