edu.washington.cs.supple.customization.command
Interface Command

All Known Implementing Classes:
CommandGeneralization, CommandReversals, CommandSingleReversal, CommandStandard

public interface Command

A command is the customization as it is issued by the user. A command can be a concrete customization at a defined location. However, it could also be a generalization of several other commands. Every command translates into one or more actions that need to be performed on the UI to execute the command.

Author:
raphael

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.
 

Method Detail

execute

public void execute(State s)
             throws ConditionViolationException
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.

Parameters:
s - state of UI
Throws:
ConditionViolationException

execute

public void execute(State s,
                    Specification spec)
             throws ConditionViolationException
Applies a command only to a part of a UI.

Parameters:
s - state of UI
spec - part of the UI where command is applied
Throws:
ConditionViolationException

getAction

public Action getAction()
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.

Returns:
action

equals

public boolean equals(Command c)
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.

Parameters:
c - another command to compare this one to

toString

public java.lang.String toString()
A string representation of the command.