Package amadeus.cognition
Class MarkCommand
java.lang.Object
amadeus.cognition.Command
amadeus.cognition.MarkCommand
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 Summary
ConstructorsConstructorDescriptionMarkCommand(String input, boolean mark) Constructs a newMarkCommandby parsing the user input. -
Method Summary
Modifier and TypeMethodDescriptionvoidexecute()Executes the command by marking the task at the specified index as complete or incomplete.
-
Constructor Details
-
MarkCommand
Constructs a newMarkCommandby 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
AmadeusExceptionis thrown.- Parameters:
input- the user input containing the task index; must not benullor 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
Executes the command by marking the task at the specified index as complete or incomplete.- Specified by:
executein classCommand- Throws:
AmadeusException- if an error occurs while updating the task status.
-