标签:style blog io color ar os sp div on
private void mySort(List<Map<String, Object>> list) { //list为待排序的集合,按SEQ字段排序 Comparator<Map<String, String>> mapComprator = new Comparator<Map<String, String>>() { @Override public int compare(Map<String, String> o1, Map<String, String> o2) { if (Integer.valueOf(o1.get("SEQ").toString()) > Integer.valueOf(o2.get("SEQ").toString())) { return 1; //此处是按降序排序 } else { return -1; } } }; Collections.sort((List)list, mapComprator); }
对List<Map<String, Object>>集合排序
标签:style blog io color ar os sp div on
原文地址:http://www.cnblogs.com/dj168/p/4076725.html