Class History

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

public class History extends Command
Command that prints the command history
  • Constructor Details

    • History

      public History()
  • 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()
      Executes the History command
      Specified by:
      execute in interface CommandInterface
      Specified by:
      execute in class Command
    • checkArgument

      public boolean checkArgument(Object inputArgument)
      Checks whether the argument is valid for the History command
      Specified by:
      checkArgument in interface CommandInterface
      Specified by:
      checkArgument in class Command
      Parameters:
      inputArgument - the argument to check
      Returns:
      true if the argument is null, false otherwise
    • printHistory

      public static void printHistory()
      Prints the command history
    • initializeCommandsHistoryQueue

      public static void initializeCommandsHistoryQueue()
      Initializes the command history queue
    • addToCommandsHistoryQueue

      public static void addToCommandsHistoryQueue(String command)
      Adds a command to the command history queue
      Parameters:
      command - the command to add