Class FeedbackDataManager

java.lang.Object
bcu.cmp5332.bookingsystem.data.FeedbackDataManager
All Implemented Interfaces:
DataManager

public class FeedbackDataManager extends Object implements DataManager
  • Constructor Details

    • FeedbackDataManager

      public FeedbackDataManager()
  • Method Details

    • loadData

      public void loadData(FlightBookingSystem fbs) throws IOException, FlightBookingSystemException
      Loads existing feedback data from the feedback data file into the provided FlightBookingSystem instance. Each line in the file represents a feedback record with fields separated by the SEPARATOR.
      Specified by:
      loadData in interface DataManager
      Parameters:
      fbs - The FlightBookingSystem instance to load feedback data into
      Throws:
      IOException - If there is an error reading the data file
      FlightBookingSystemException - If there is an error parsing the feedback data
    • storeData

      public void storeData(FlightBookingSystem fbs) throws IOException
      Stores current feedback data from the provided FlightBookingSystem instance into the feedback data file. Each feedback's details are formatted and written to the file, separated by the SEPARATOR.
      Specified by:
      storeData in interface DataManager
      Parameters:
      fbs - The FlightBookingSystem instance to store feedback data from
      Throws:
      IOException - If there is an error writing data to the file