Package commandManagers.commands
Class SumOfMetersAboveSeaLevel
java.lang.Object
commandManagers.Command
commandManagers.commands.SumOfMetersAboveSeaLevel
- All Implemented Interfaces:
CommandInterface
Command class for computing the sum of meters above sea level of all cities in the collection.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancheckArgument(Object inputArgument) Checks if the input argument is null, and returns true if it is, or false and prints an error message otherwise.voidexecute()Computes the sum of meters above sea level of all cities in the collection and prints it to the console.getDescr()Base method for show command description.getName()Base method for show command nameMethods inherited from class commandManagers.Command
getArgument, isHasArgument, setArgument
-
Constructor Details
-
SumOfMetersAboveSeaLevel
public SumOfMetersAboveSeaLevel()
-
-
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()Computes the sum of meters above sea level of all cities in the collection and prints it to the console.- Specified by:
executein interfaceCommandInterface- Specified by:
executein classCommand
-
checkArgument
Checks if the input argument is null, and returns true if it is, or false and prints an error message otherwise.- Specified by:
checkArgumentin interfaceCommandInterface- Specified by:
checkArgumentin classCommand- Parameters:
inputArgument- the argument to check- Returns:
- true if the input argument is null, false otherwise
-