Class MarkCommand

java.lang.Object
amadeus.cognition.Command
amadeus.cognition.MarkCommand

public class MarkCommand extends Command
Command to mark a task as complete or incomplete.

This command parses the user input to identify the task index and updates its status. The input is expected to contain a valid task index.

  • Constructor Details

    • MarkCommand

      public MarkCommand(String input, boolean mark) throws AmadeusException
      Constructs a new MarkCommand by parsing the user input.

      The input is expected to contain a valid task index. If the input is empty or the index is invalid, an AmadeusException is thrown.

      Parameters:
      input - the user input containing the task index; must not be null or empty.
      mark - indicates whether the task should be marked as complete (true) or incomplete (false).
      Throws:
      AmadeusException - if the input is empty or the index is invalid.
  • Method Details

    • execute

      public void execute() throws AmadeusException
      Executes the command by marking the task at the specified index as complete or incomplete.
      Specified by:
      execute in class Command
      Throws:
      AmadeusException - if an error occurs while updating the task status.