Package bcu.cmp5332.bookingsystem.data
Class FeedbackDataManager
java.lang.Object
bcu.cmp5332.bookingsystem.data.FeedbackDataManager
- All Implemented Interfaces:
DataManager
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Loads existing feedback data from the feedback data file into the provided FlightBookingSystem instance.void
Stores current feedback data from the provided FlightBookingSystem instance into the feedback data file.
-
Constructor Details
-
FeedbackDataManager
public FeedbackDataManager()
-
-
Method Details
-
loadData
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 interfaceDataManager
- Parameters:
fbs
- The FlightBookingSystem instance to load feedback data into- Throws:
IOException
- If there is an error reading the data fileFlightBookingSystemException
- If there is an error parsing the feedback data
-
storeData
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 interfaceDataManager
- Parameters:
fbs
- The FlightBookingSystem instance to store feedback data from- Throws:
IOException
- If there is an error writing data to the file
-