Class EventCommand

java.lang.Object
amadeus.cognition.Command
amadeus.cognition.EventCommand

public class EventCommand extends Command
Command to add a new Event task to the task list.

This command parses the user input to create an Event task and adds it to the list. The input is expected to contain a description, a start time, and an end time, separated by /from and /to.

  • Constructor Details

    • EventCommand

      public EventCommand(String input) throws AmadeusException
      Constructs a new EventCommand by parsing the user input.

      The input is expected to contain a description, a start time, and an end time, separated by /from and /to. If the input is empty, missing required parts, or contains an invalid time range, an AmadeusException is thrown.

      Parameters:
      input - the user input containing the task description, start time, and end time; must not be null or empty.
      Throws:
      AmadeusException - if the input is empty, in an invalid format, or contains an invalid time range.
  • Method Details