HashMap<Integer,ClassGroupModel> hashS1=new HashMap<Integer, ClassGroupModel>();
//遍历有效公司的排序 ArrayList<Map.Entry<Integer,ClassGroupModel>> listG= new ArrayList<Map.Entry<Integer,ClassGroupModel>>(hashS1.entrySet()); Collections.sort(listG, new Comparator<Map.Entry<Integer, ClassGroupModel>>() { public int compare(Map.Entry<Integer, ClassGroupModel> o1, Map.Entry<Integer, ClassGroupModel> o2) { return (new Double(o2.getValue().getOwnerEquity()).intValue()- new Double(o1.getValue().getOwnerEquity()).intValue()); } });
ps:o2-o1 倒序 o1-o2 正序 进行排序的值必须要是int类型