Class DefinePositionCommand

java.lang.Object
  |
  +--Command
        |
        +--DefinePositionCommand

public class DefinePositionCommand
extends Command

A class that encapsulates a command to define a name for a particular position of the robot. This class is a concrete implementation of the Command class, and is a part of REMOTE's implementation of the Command Pattern, as demonstrated in Gamma et al (page 236).

See Also:
SimulationEngine, CommandQueue

Constructor Summary
DefinePositionCommand(int lineNumber, java.lang.String name)
          Creates a new DefinePositionCommand which will associate a name with a particular position of the Robot at run-time.
 
Method Summary
 void Execute()
          Instructs the Robot to associate the robot current's position with the given name.
 
Methods inherited from class Command
getSourceLine, setSourceLine
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefinePositionCommand

public DefinePositionCommand(int lineNumber,
                             java.lang.String name)
Creates a new DefinePositionCommand which will associate a name with a particular position of the Robot at run-time.
Parameters:
lineNumber - the source line for this command.
name - the name to associate with the Robot's position.
Method Detail

Execute

public void Execute()
             throws java.lang.Exception
Instructs the Robot to associate the robot current's position with the given name.
Throws:
thrown - if an error occurs attempting to execute the command.
Overrides:
Execute in class Command