Package commandManagers.commands
Class RemoveById
java.lang.Object
commandManagers.Command
commandManagers.commands.RemoveById
- All Implemented Interfaces:
CommandInterface
Class RemoveById provides removal of an element from the collection by its ID number.
Extends the Command class.
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs a new command with the specified argument requirement. -
Method Summary
Modifier and TypeMethodDescriptionbooleancheckArgument(Object inputArgument) Checks if the given inputArgument is valid for this command.voidexecute()Overrides the method execute() in the Command class.getDescr()Base method for show command description.getName()Base method for show command nameMethods inherited from class commandManagers.Command
getArgument, isHasArgument, setArgument
-
Constructor Details
-
RemoveById
public RemoveById()Constructs a new command with the specified argument requirement.
-
-
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()Overrides the method execute() in the Command class. Removes an element from the collection by its ID number. Checks the argument before execution.- Specified by:
executein interfaceCommandInterface- Specified by:
executein classCommand
-
checkArgument
Description copied from class:CommandChecks if the given inputArgument is valid for this command.- Specified by:
checkArgumentin interfaceCommandInterface- Specified by:
checkArgumentin classCommand- Parameters:
inputArgument- the argument to check.- Returns:
- true if the argument is valid, false otherwise.
-