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

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

public class CommandGeneralization
extends java.lang.Object
implements Command

A generalization command as it is issued by the user.

Author:
raphael

Constructor Summary
CommandGeneralization(Action action, Scope scope, java.util.List generalizedCommands)
          To create a generalization command, an abstract scope definition has to be provided.
 
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

CommandGeneralization

public CommandGeneralization(Action action,
                             Scope scope,
                             java.util.List generalizedCommands)
To create a generalization command, an abstract scope definition has to be provided. The "generalizedCommands" list should contain references to the commands that were used to compute the generalization.

Parameters:
action -
scope -
generalizedCommands -
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