http://www.iteye.com/problems/86110

——————————————————————————————————————————————————————————

List<Bill> list = billFacade.findBillByUserId(userInfo); 
Map<String, Float> group = new HashMap<String, Float>();
String type = null;
Float moneyTotal = 0f;
for(Bill bill : list){
type = bill.getType();
            
moneyTotal = group.get(type);
            
if(moneyTotal == null){
                
moneyTotal = 0f;
            
}
            
group.put(type, moneyTotal + bill.getMoney());
        
}

 

posted on 2015-03-11 11:04  网络大豆  阅读(2413)  评论(0编辑  收藏  举报