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 TypeMethodDescriptionboolean
checkArgument
(Object inputArgument) Checks if the input argument is null, and returns true if it is, or false and prints an error message otherwise.void
execute()
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:Command
Base method for show command name- Specified by:
getName
in interfaceCommandInterface
- Specified by:
getName
in classCommand
- Returns:
- command name
-
getDescr
Description copied from class:Command
Base method for show command description.- Specified by:
getDescr
in interfaceCommandInterface
- Specified by:
getDescr
in 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:
execute
in interfaceCommandInterface
- Specified by:
execute
in 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:
checkArgument
in interfaceCommandInterface
- Specified by:
checkArgument
in classCommand
- Parameters:
inputArgument
- the argument to check- Returns:
- true if the input argument is null, false otherwise
-