Package commandManagers.commands
Class Clear
java.lang.Object
commandManagers.Command
commandManagers.commands.Clear
- All Implemented Interfaces:
CommandInterface
Command to clear the collection.
- Author:
- boris
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancheckArgument(Object inputArgument) Checks whether an argument is provided or not.voidexecute()Clears the collection if no argument is provided.getDescr()Base method for show command description.getName()Base method for show command nameMethods inherited from class commandManagers.Command
getArgument, isHasArgument, setArgument
-
Constructor Details
-
Clear
public Clear()
-
-
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()Clears the collection if no argument is provided. Prints a message indicating that the command does not take arguments otherwise.- Specified by:
executein interfaceCommandInterface- Specified by:
executein classCommand
-
checkArgument
Checks whether an argument is provided or not.- Specified by:
checkArgumentin interfaceCommandInterface- Specified by:
checkArgumentin classCommand- Parameters:
inputArgument- the argument to be checked.- Returns:
- true if no argument is provided and false otherwise.
-