Class MessageLoader

Object
MessageLoader

public class MessageLoader extends Object
This utility class contains methods that will read in a file as it is provided, and load the data into an ArrayList with OpenMessage objects inside of it.
  • Constructor Details

    • MessageLoader

      public MessageLoader()
  • Method Details

    • loadFile

      public static ArrayList<OpenMessage> loadFile(String filename)
      This method reads through a file, and builds a number of Message objects based on the contents of that file. It then returns an ArrayList for each Message. Implemented in Lab 10.
      Parameters:
      filename - Name of file to be opened.
      Returns:
      An ArrayList with 0 or more messages.
    • parseLine

      public static String parseLine(String line)
      Takes in a line, in which one must grab the substring *after* the ":". It will also remove any leading and trailing spaces. Implemented in Lab 10.
      Parameters:
      line - Line to parse
      Returns:
      parsed line