當hashMap的key是多個字段
view plaincopy to clipboardprint?
import java
//inquiry result
List fromDetailList = instHdDao
// Initial Value
Integer dtTotalTruck =
Integer dtTotalQuantity =
Map hm = new HashMap();
Iterator it = erator();
while(it
MeInstHd meInstHd = (MeInstHd)it
List arr
List arr
List arr
String carrierCd = meInstHd
arr
if(ntainsKey(arr
// carrierCd is exist in hm
arr
dtTotalQuantity = (Integer)arr
dtTotalQuantity += meInstHd
dtTotalTruck = (Integer)arr
dtTotalTruck +=
arr
arr
hm
}
else{
// carrierCd is not exist in hm
arr
arr
hm
}
}
From:http://tw.wingwit.com/Article/program/Java/hx/201311/27090.html