Class RemoveGreater

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

public class RemoveGreater extends Command
This class represents the RemoveGreater command in the program. When executed, it removes all elements from the collection that have a population greater than the specified city.
  • Constructor Details

    • RemoveGreater

      public RemoveGreater()
      Default constructor from 1.0
    • RemoveGreater

      public RemoveGreater(ModeManager<City> handler)
      Provides choosing handler
      Parameters:
      handler - ModuleHandler for operating
      Since:
      2.0
  • 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() throws BuildObjectException
      Executes the RemoveGreater command. Removes all elements from the collection that have a population greater than the specified city.
      Specified by:
      execute in interface CommandInterface
      Specified by:
      execute in class Command
      Throws:
      BuildObjectException
    • checkArgument

      public boolean checkArgument(Object inputArgument)
      Checks whether the given argument is valid for this command. Since this command doesn't require an argument, this method always returns true.
      Specified by:
      checkArgument in interface CommandInterface
      Specified by:
      checkArgument in class Command
      Parameters:
      inputArgument - the argument to be checked
      Returns:
      true since this command doesn't require an argument