Java汇总List数据 _JAVA_编程开发_程序员俱乐部

中国优秀的程序员网站程序员频道CXYCLUB技术地图
热搜:
更多>>
 
您所在的位置: 程序员俱乐部 > 编程开发 > JAVA > Java汇总List数据

Java汇总List数据

 2012/1/17 9:07:23  qiaolevip  程序员俱乐部  我要评论(0)
  • 摘要:list=totallogService.retrieve();if(list.size()>0){totallog=newTotallog();inthandled=0;intreported=0;intunassigned=0;intuntreated=0;for(inti=0;i<list.size();i++){handled+=list.get(i).getHandled();reported+=list.get(i).getReported()
  • 标签:
list = totallogService.retrieve();
		if (list.size() > 0) {
			totallog = new Totallog();
			int handled = 0;
			int reported = 0;
			int unassigned = 0;
			int untreated = 0;
			for (int i = 0; i < list.size(); i++) {
				handled += list.get(i).getHandled();
				reported += list.get(i).getReported();
				unassigned += list.get(i).getUnassigned();
				untreated += list.get(i).getUntreated();

				totallog.setLastTime(list.get(i).getLastTime());
			}
			totallog.setHandled(handled);
			totallog.setReported(reported);
			totallog.setUnassigned(unassigned);
			totallog.setUntreated(untreated);
			list.add(totallog);
		}
  • 相关文章
发表评论
用户名: 匿名