标签:details result new hash contains 重复 过滤 add span
1 HashSet<Integer> hashSet = new HashSet<Integer>(); 2 for (int i = resultDoctorDetails.size() - 1; i >= 0; --i) { 3 ResultDoctorDetail temp = resultDoctorDetails.get(i); 4 if (!hashSet.contains(temp.getUserId())) { 5 hashSet.add(temp.getUserId()); 6 } else { 7 resultDoctorDetails.remove(i); 8 } 9 }
标签:details result new hash contains 重复 过滤 add span
原文地址:http://www.cnblogs.com/xjbBill/p/5884200.html