List排序

private List sortList(List list) {
java.util.Collections.sort(list, new Comparator() {
@Override
public int compare(Object o1, Object o2) {
Object[] a1 = (Object[]) o1;
Object[] a2 = (Object[]) o2;
if (Integer.parseInt(a1[1].toString()) <= Integer
.parseInt(a2[1].toString())) {
return 1;
} else {
return 0;
}
}

});
return list;
}

你可能感兴趣的:(list排序)