标签:lis integer code compare oid sort void tor turn
private void sort(List<Map<String, Object>> list) { Collections.sort(list, new Comparator<Map<String, Object>>(){ public int compare(Map<String, Object> o1, Map<String, Object> o2) { //依据map中某个字段,从小到大排序 return (Integer)o1.get("num")>(Integer)o2.get("num")?1:( (Integer)o1.get("num")==(Integer)o2.get("num")?0:-1); } }); }
list中依据map<String,Object>的某个值排序
标签:lis integer code compare oid sort void tor turn
原文地址:http://www.cnblogs.com/yfceshi/p/6789468.html