Package commandManagers.commands
Class Show
java.lang.Object
commandManagers.Command
commandManagers.commands.Show
- All Implemented Interfaces:
CommandInterface
Command to show all cities in the collection.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancheckArgument(Object inputArgument) Checks if the input argument is valid for the Show command.voidexecute()Executes the Show command by printing all the cities in the collection.getDescr()Base method for show command description.getName()Base method for show command nameMethods inherited from class commandManagers.Command
getArgument, isHasArgument, setArgument
-
Constructor Details
-
Show
public Show()
-
-
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
public void execute()Executes the Show command by printing all the cities in the collection. The method calls the checkArgument method to validate the input argument before execution.- Specified by:
executein interfaceCommandInterface- Specified by:
executein classCommand
-
checkArgument
Checks if the input argument is valid for the Show command. The input argument should be null.- Specified by:
checkArgumentin interfaceCommandInterface- Specified by:
checkArgumentin classCommand- Parameters:
inputArgument- the input argument to be checked- Returns:
- true if the input argument is valid, false otherwise
-