Package amadeus.brain


package amadeus.brain
Provides core functionality for managing data and handling errors in the Amadeus application.

This package includes classes responsible for:

  • Data Persistence: The Database class handles saving and loading tasks to/from a file, ensuring data persistence across application sessions.
  • Error Handling: The AmadeusException class defines custom exceptions for domain-specific errors, such as invalid commands, missing arguments, and file I/O issues.

The classes in this package are designed to work together to ensure robust data management and error handling, enabling the application to maintain consistency and provide meaningful feedback to users.

Key Classes

  • Database: Manages the storage and retrieval of tasks, ensuring data persistence.
  • AmadeusException: Handles domain-specific errors and provides user-friendly error messages.

Usage Example

 try {
     // Load tasks from the database
     ArrayList<Task> tasks = Database.load();

     // Perform operations on tasks
     tasks.add(new ToDo("Complete JavaDoc"));

     // Save tasks back to the database
     Database.save(tasks);
 } catch (AmadeusException e) {
     System.out.println(e.getMessage()); // Handle errors gracefully
 }
 
See Also:
  • Class
    Description
    Represents a custom exception class for handling domain-specific errors in the Amadeus application.
    Manages the storage and retrieval of tasks in the Amadeus application.