Пример #1
0
  /**
   * takes a catalog(file) and returns a hashmap of ProductSpecs with key being the upc
   *
   * @param fileName
   * @return HashMap<ProductSpec>
   * @throws IOException
   */
  public static HashMap getCatalog(String fileName) throws IOException {
    ProductReader read = new ProductReader(fileName);
    ProductReader.init();
    ProductReader.close();

    return productCatalog;
  }
Пример #2
0
  /**
   * use to test product reader
   *
   * @param args
   * @throws IOException
   */
  public static void main(String[] args) throws IOException {

    HashMap catalog = ProductReader.getCatalog("productCatalog.txt");

    System.out.println("It worked");
  }