Map<Long, List<DbnFormItem>> createJobidMap(List<DbnFormItem> dbnList) {
Map<Long, List<DbnFormItem>> jobIdAndListMap = new HashMap<Long, List<DbnFormItem>>();
for (DbnFormItem tmp : dbnList) {
if (jobIdAndListMap.containsKey(tmp.getPositionId())) {
jobIdAndListMap.get(tmp.getPositionId()).add(tmp);
} else {
List<DbnFormItem> tempList = new ArrayList<DbnFormItem>();
tempList.add(tmp);
jobIdAndListMap.put(tmp.getPositionId(), tempList);
}
hashMap找key的时候貌似是直接hash然后去找
于是乎
分拣起来效率还是非常高的~