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 TypeMethodDescriptionboolean
checkArgument
(Object inputArgument) Checks whether an argument is provided or not.void
execute()
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: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()Clears the collection if no argument is provided. Prints a message indicating that the command does not take arguments otherwise.- Specified by:
execute
in interfaceCommandInterface
- Specified by:
execute
in classCommand
-
checkArgument
Checks whether an argument is provided or not.- Specified by:
checkArgument
in interfaceCommandInterface
- Specified by:
checkArgument
in classCommand
- Parameters:
inputArgument
- the argument to be checked.- Returns:
- true if no argument is provided and false otherwise.
-