遍歷HashMap和Map

   HashMap mwtHm = new HashMap();

    wtay = new BigDecimal[2];

    wtay[0] = swmd.getReqqty();
    wtay[1] = swmd.getReqwt();

     mwtHm.put(swmd.getAlloyid(), wtay);

    if (mwtHm != null && mwtHm.size() > 0) {
                Iterator iter = mwtHm.entrySet().iterator();
                    while (iter.hasNext()) {
                                    Map.Entry entry = (Map.Entry) iter.next();
                                    String key = (String) entry.getKey();
                                    wtay = (BigDecimal[]) entry.getValue();

                                    fwm = new Facswoimodel(new FacswoimodelPK());
                                    fwm.getFacswoimodelPK().setSworderid(swmd.getFacswormodelPK().getSworderid());
                                    fwm.getFacswoimodelPK().setAlloyid(key);
                                    fwm.setWt(wtay[1]);
                                    fwm.setQty(wtay[0]);
                                    swomList.add(fwm);
             }
        }

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章