Class Command

java.lang.Object
amadeus.cognition.Command
Direct Known Subclasses:
ByeCommand, CheckCommand, CommandList, DeadlineCommand, DeleteCommand, EventCommand, FindCommand, ListCommand, MarkCommand, ResetCommand, ToDoCommand

public abstract class Command extends Object
Abstract base class for all commands in the Amadeus application.

This class defines the structure for commands, including the execute() method that must be implemented by subclasses and the isBye() method to check if the command is a termination command.

  • Constructor Details

    • Command

      public Command()
  • Method Details

    • execute

      public abstract void execute() throws AmadeusException
      Executes the command.

      This method must be implemented by subclasses to perform the specific action associated with the command.

      Throws:
      AmadeusException - if an error occurs during execution.
    • isBye

      public boolean isBye()
      Checks if the command is a termination command (e.g., bye).

      This method can be overridden by subclasses to indicate that the command should terminate the application.

      Returns:
      true if the command is a termination command, false otherwise.