Esempio n. 1
0
  private static void createMap() throws IOException {
    if (manufacturers == null) return;

    Iterator iter = manufacturers.iterator();
    while (iter.hasNext()) {
      RcopiaInfo item = (RcopiaInfo) iter.next();
      map.put(item.getID(), item);
    }
  }
  private void createMap(ArrayList variances) throws IOException {
    if (variances == null) return;

    Iterator iter = variances.iterator();
    while (iter.hasNext()) {
      RcopiaInfo variance = (RcopiaInfo) iter.next();
      String stateCode = variance.getString(STATECODE);
      if (Str.isEmpty(stateCode)) {
        logger.log("No statecode in variance record " + variance.getID());
        continue;
      }

      String key = variance.getString(KEY);
      String value = variance.getString(VALUE);

      HashMap stateMap = (HashMap) varianceMap.get(stateCode);
      if (stateMap == null) {
        stateMap = new HashMap();
        varianceMap.put(stateCode, stateMap);
      }

      stateMap.put(key, value);
    }
  }