Class Help

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

public class Help extends Command
The Help class is a command that provides information about the available commands in the program. It extends the Command class and overrides its execute() and checkArgument() methods.
  • Constructor Details

    • Help

      public Help()
  • 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()
      Prints information about the available commands in the program to the console. Overrides execute() method of the Command class.
      Specified by:
      execute in interface CommandInterface
      Specified by:
      execute in class Command
    • checkArgument

      public boolean checkArgument(Object inputArgument)
      Checks if the argument of the Exit command is null. If the argument is not null, prints a message to the console indicating that the Exit command does not take any arguments. Overrides the checkArgument() method of the Command class.
      Specified by:
      checkArgument in interface CommandInterface
      Specified by:
      checkArgument in class Command
      Parameters:
      inputArgument - the argument of the Exit command
      Returns:
      true if the inputArgument is null, false otherwise