Class TimetableManager

java.lang.Object
TimetableManager

public class TimetableManager extends Object
Utility class for serializing, deserializing, and formatting timetable data.
  • Constructor Details

    • TimetableManager

      public TimetableManager()
  • Method Details

    • deserializeTimetable

      public static String[][] deserializeTimetable(String binaryPath)
      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 null if an error occurs.
    • formatTimetable

      public static String[][] formatTimetable(List<List<String>> timetable)
      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

      public static void serializeTimetable(String[][] timetable, String binaryPath) throws IOException
      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.