Java 中List<Map<String,String>>排序问题
public static void mapSorts(List<Map<String, String>> map) {
Collections.sort(map, new Comparator<Map<String, String>>() {
@Override
public int compare(Map<String, String> o1, Map<String, String> o2) {
// TODO Auto-generated method stub
if (Double.parseDouble(o1.get("sumall").toString())>Double.parseDouble(o2.get("sumall").toString()) ) {
return -1;
}
return 1;
}
});
}