1、Ordering排序
List<Integer> nums = new ArrayList<Integer>();//1,2,3,4,5,6
Ordering<Object> ordering = new Ordering<>(){
public int compare(Object o1,Object o2){
return -1;
}
}
ordering.sortedCopy(nums);
6,5,4,3,2,1
List<Integer> nums = new ArrayList<Integer>();//1,2,3,4,5,6
Ordering<Object> ordering = new Ordering<>(){
public int compare(Object o1,Object o2){
return 1;
}
}
ordering.sortedCopy(nums);
1,2,3,4,5,6