Package commandManagers.commands
Class RemoveGreater
java.lang.Object
commandManagers.Command
commandManagers.commands.RemoveGreater
- All Implemented Interfaces:
CommandInterface
This class represents the RemoveGreater command in the program. When executed, it removes all
elements from the collection that have a population greater than the specified city.
-
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor from 1.0RemoveGreater
(ModeManager<City> handler) Provides choosing handler -
Method Summary
Modifier and TypeMethodDescriptionboolean
checkArgument
(Object inputArgument) Checks whether the given argument is valid for this command.void
execute()
Executes the RemoveGreater command.getDescr()
Base method for show command description.getName()
Base method for show command nameMethods inherited from class commandManagers.Command
getArgument, isHasArgument, setArgument
-
Constructor Details
-
RemoveGreater
public RemoveGreater()Default constructor from 1.0 -
RemoveGreater
Provides choosing handler- Parameters:
handler
- ModuleHandler for operating- Since:
- 2.0
-
-
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
Executes the RemoveGreater command. Removes all elements from the collection that have a population greater than the specified city.- Specified by:
execute
in interfaceCommandInterface
- Specified by:
execute
in classCommand
- Throws:
BuildObjectException
-
checkArgument
Checks whether the given argument is valid for this command. Since this command doesn't require an argument, this method always returns true.- Specified by:
checkArgument
in interfaceCommandInterface
- Specified by:
checkArgument
in classCommand
- Parameters:
inputArgument
- the argument to be checked- Returns:
- true since this command doesn't require an argument
-