Esempio n. 1
0
  /**
   * Reads from data file using FileProcessor and stores in MusicStore
   *
   * @return Returns a MusicStore instance which has all the music records read from data file
   */
  public MusicStore read() {

    try {
      String line = null;
      StringTokenizer st = null;
      while ((line = fp.readLineFromFile()) != null) {
        // System.out.println("Line : " + line +"\n");

        st = new StringTokenizer(line);
        if (st.countTokens() == 3) mi.storeInfo(st.nextToken(), st.nextToken(), st.nextToken());
      }
    } catch (NullPointerException ex) {
      System.err.println("Null value read from Data file " + ex.getMessage());
      System.exit(1);
    } finally {
    }

    return mi;
  }