Class Show

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

public class Show extends Command
Command to show all cities in the collection.
  • Constructor Details

    • Show

      public Show()
  • 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 Show command by printing all the cities in the collection. The method calls the checkArgument method to validate the input argument before execution.
      Specified by:
      execute in interface CommandInterface
      Specified by:
      execute in class Command
    • checkArgument

      public boolean checkArgument(Object inputArgument)
      Checks if the input argument is valid for the Show command. The input argument should be null.
      Specified by:
      checkArgument in interface CommandInterface
      Specified by:
      checkArgument in class Command
      Parameters:
      inputArgument - the input argument to be checked
      Returns:
      true if the input argument is valid, false otherwise