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 TypeMethodDescriptionbooleancheckArgument(Object inputArgument) Checks whether the given argument is valid for this command.voidexecute()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: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
Executes the RemoveGreater command. Removes all elements from the collection that have a population greater than the specified city.- Specified by:
executein interfaceCommandInterface- Specified by:
executein 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:
checkArgumentin interfaceCommandInterface- Specified by:
checkArgumentin classCommand- Parameters:
inputArgument- the argument to be checked- Returns:
- true since this command doesn't require an argument
-