Package commandManagers.commands
Class Add
java.lang.Object
commandManagers.Command
commandManagers.commands.Add
- All Implemented Interfaces:
CommandInterface
Command to add a new city to the collection.
- Author:
- boris
-
Constructor Summary
ConstructorsConstructorDescriptionAdd()Default constructor from 1.0Add(ModeManager<City> handler) Provides choosing handler -
Method Summary
Modifier and TypeMethodDescriptionbooleancheckArgument(Object inputArgument) Checks whether an argument is provided or not.voidexecute()Adds a new city to the collection if an argument is not provided.getDescr()Base method for show command description.getName()Base method for show command nameMethods inherited from class commandManagers.Command
getArgument, isHasArgument, setArgument
-
Constructor Details
-
Add
public Add()Default constructor from 1.0 -
Add
Provides choosing handler- Parameters:
handler- ModuleHandler for operating- Since:
- 2.0
-
-
Method Details
-
getName
Description copied from class:CommandBase method for show command name- Specified by:
getNamein interfaceCommandInterface- Specified by:
getNamein classCommand- Returns:
- command name
-
getDescr
Description copied from class:CommandBase method for show command description.- Specified by:
getDescrin interfaceCommandInterface- Specified by:
getDescrin classCommand- Returns:
- command description
-
execute
Adds a new city to the collection if an argument is not provided. Prints a message indicating that the command does not take arguments otherwise.- Specified by:
executein interfaceCommandInterface- Specified by:
executein classCommand- Throws:
BuildObjectException
-
checkArgument
Checks whether an argument is provided or not.- Specified by:
checkArgumentin interfaceCommandInterface- Specified by:
checkArgumentin classCommand- Parameters:
inputArgument- the argument to be checked.- Returns:
- true if no argument is provided and false otherwise.
-