Package amadeus.cognition
Class EventCommand
java.lang.Object
amadeus.cognition.Command
amadeus.cognition.EventCommand
-
Constructor Summary
ConstructorsConstructorDescriptionEventCommand(String input) Constructs a newEventCommandby parsing the user input. -
Method Summary
-
Constructor Details
-
EventCommand
Constructs a newEventCommandby parsing the user input.The input is expected to contain a description, a start time, and an end time, separated by
/fromand/to. If the input is empty, missing required parts, or contains an invalid time range, anAmadeusExceptionis thrown.- Parameters:
input- the user input containing the task description, start time, and end time; must not benullor empty.- Throws:
AmadeusException- if the input is empty, in an invalid format, or contains an invalid time range.
-
-
Method Details
-
execute
Executes the command by adding theEventtask to the task list.- Specified by:
executein classCommand- Throws:
AmadeusException- if an error occurs while adding the task.
-