Class CheckCommand

java.lang.Object
amadeus.cognition.Command
amadeus.cognition.CheckCommand

public class CheckCommand extends Command
Command to filter tasks based on a date or date range.

This command parses the user input to identify a date or date range (e.g., "before", "after", or exact date) and filters tasks that match the specified condition.

  • Constructor Details

    • CheckCommand

      public CheckCommand(String argument) throws AmadeusException
      Constructs a new CheckCommand by parsing the user input for the date or date range.

      The input is expected to contain a valid date or date range (e.g., "before 31/12/2025"). If the input is empty or invalid, an AmadeusException is thrown.

      Parameters:
      argument - the user input containing the date or date range; must not be null or empty.
      Throws:
      AmadeusException - if the input is empty or invalid.
  • Method Details

    • execute

      public void execute()
      Executes the command by displaying the filtered tasks.

      If no tasks match the specified date or date range, a message is displayed to inform the user. Otherwise, the matching tasks are displayed using Speech.sayList(java.util.ArrayList).

      Specified by:
      execute in class Command