当前位置: 代码迷 >> Web前端 >> Java集锦List数据
  详细解决方案

Java集锦List数据

热度:360   发布时间:2012-09-12 09:21:30.0
Java汇总List数据
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);
		}
  相关解决方案