Package gov.nasa.jpl.command
Class NewActivityCommand
java.lang.Object
gov.nasa.jpl.command.NewActivityCommand
- All Implemented Interfaces:
Command
This class takes in a class object and object array of parameters
for that class and then instantiates the class.
-
Constructor Summary
ConstructorsConstructorDescriptionNewActivityCommand
(String commandString) This function parses an input commandString and stores the variables needed to execute a newActivity command. -
Method Summary
-
Constructor Details
-
NewActivityCommand
This function parses an input commandString and stores the variables needed to execute a newActivity command. This includes an activity name followed by parameter type value pairs, separated by commas. Ex: ActivityOne (String "hello", Integer 1)- Parameters:
commandString
- - string of activity name followed by parameter type/value pairs
-
-
Method Details
-
execute
This method adds the new activity instance to the plan.- Specified by:
execute
in interfaceCommand
- Throws:
CommandException
-
unExecute
Undoes the NewActivityCommand by removing the activity with the ID of the newly added activity. This is implemented by calling a new RemoveActivityCommand on the ID of the activity.- Specified by:
unExecute
in interfaceCommand
- Throws:
CommandException
-