Class Clear

java.lang.Object
commandManagers.Command
commandManagers.commands.Clear
All Implemented Interfaces:
CommandInterface

public class Clear extends Command
Command to clear the collection.
Author:
boris
  • Constructor Details

    • Clear

      public Clear()
  • Method Details

    • getName

      public String getName()
      Description copied from class: Command
      Base method for show command name
      Specified by:
      getName in interface CommandInterface
      Specified by:
      getName in class Command
      Returns:
      command name
    • getDescr

      public String getDescr()
      Description copied from class: Command
      Base method for show command description.
      Specified by:
      getDescr in interface CommandInterface
      Specified by:
      getDescr in class Command
      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 interface CommandInterface
      Specified by:
      execute in class Command
    • checkArgument

      public boolean checkArgument(Object inputArgument)
      Checks whether an argument is provided or not.
      Specified by:
      checkArgument in interface CommandInterface
      Specified by:
      checkArgument in class Command
      Parameters:
      inputArgument - the argument to be checked.
      Returns:
      true if no argument is provided and false otherwise.