Class TimetableManager
java.lang.Object
TimetableManager
Utility class for serializing, deserializing, and formatting timetable data.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic String[][]deserializeTimetable(String binaryPath) Deserialize timetable data from a binary file.static String[][]formatTimetable(List<List<String>> timetable) Format a timetable from a list of lists to a two-dimensional array.static voidserializeTimetable(String[][] timetable, String binaryPath) Serialize timetable data to a binary file.
-
Constructor Details
-
TimetableManager
public TimetableManager()
-
-
Method Details
-
deserializeTimetable
Deserialize timetable data from a binary file.- Parameters:
binaryPath- The path to the binary file.- Returns:
- The deserialized timetable data as a two-dimensional array of strings, or
nullif an error occurs.
-
formatTimetable
Format a timetable from a list of lists to a two-dimensional array.- Parameters:
timetable- The timetable data as a list of lists, where each inner list represents a row of the timetable.- Returns:
- The formatted timetable data as a two-dimensional array of strings.
-
serializeTimetable
Serialize timetable data to a binary file.- Parameters:
timetable- The timetable data to be serialized, represented as a two-dimensional array of strings.binaryPath- The path to the binary file where the serialized timetable data will be written.- Throws:
IOException- If an I/O error occurs while writing the data to the file.
-