for (Iterator i = p.iterator(); i.hasNext();) { String s = (String) i.next(); if ((idx = s.indexOf('=')) != -1) { String key = new String(s.substring(0, idx)); String value = new String(s.substring(idx + 1, s.length())); map.put(key.trim(), value.trim()); } } supplyType = (String) map.get(SUPPLY_TYPE); String supplyClassPGStr = (String) map.get(SUPPLY_PG_CLASS); if (((supplyType == null) || (supplyClassPGStr == null) || (supplyClassPGStr.trim().equals("")) && logger.isErrorEnabled())) { logger.error(errorString); } else { try { supplyClassPG = Class.forName(supplyClassPGStr); } catch (Exception e) { logger.error("Problem loading SUPPLY_PG_CLASS: " + e); logger.error(errorString); } } return map;
for (Iterator i = p.iterator(); i.hasNext();) { String s = (String) i.next(); if ((idx = s.indexOf('=')) != -1) { String key = new String(s.substring(0, idx)); String value = new String(s.substring(idx + 1, s.length())); map.put(key.trim(), value.trim()); }
    private HashMap readParameters() {        final String errorString = "DemandForecastPlugin requires 2 parameters, Supply Type and associated SupplyPGClass.  Additional parameter for csv logging, default is disabled.   e.g. org.cougaar.logistics.plugin.inventory.DemandForecastPlugin(" + SUPPLY_TYPE + "=BulkPOL, " + SUPPLY_PG_CLASS + "=org.cougaar.logistics.ldm.asset.BulkPOLPG);";        Collection p = getParameters();        if (p.isEmpty()) {            if (logger.isErrorEnabled()) {                logger.error(errorString);            }            return null;        }        HashMap map = new HashMap();        int idx;        for (Iterator i = p.iterator(); i.hasNext();) {            String s = (String) i.next();            if ((idx = s.indexOf('=')) != -1) {                String key = new String(s.substring(0, idx));                String value = new String(s.substring(idx + 1, s.length()));                map.put(key.trim(), value.trim());            }        }        supplyType = (String) map.get(SUPPLY_TYPE);        String supplyClassPGStr = (String) map.get(SUPPLY_PG_CLASS);        if (((supplyType == null) ||            (supplyClassPGStr == null) ||                (supplyClassPGStr.trim().equals(""))                && logger.isErrorEnabled()))        {            logger.error(errorString);        } else {            try {                supplyClassPG = Class.forName(supplyClassPGStr);            } catch (Exception e) {                logger.error("Problem loading SUPPLY_PG_CLASS: " + e);                logger.error(errorString);            }        }        return map;    }