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

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

public class CommandStandard
extends java.lang.Object
implements Command

A standard customization command issued by the user. It only affects a single location of the UI.

Author:
raphael

Constructor Summary
CommandStandard(Action action, UiObject location, java.lang.String application, DeviceProperties device)
           
 
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 getApplication()
           
 DeviceProperties getDevice()
           
 UiObject getLocation()
           
 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

CommandStandard

public CommandStandard(Action action,
                       UiObject location,
                       java.lang.String application,
                       DeviceProperties device)
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

getLocation

public UiObject getLocation()

getApplication

public java.lang.String getApplication()

getDevice

public DeviceProperties getDevice()

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.

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