//对List按照里面的对象从大到小进行排序
Collections.sort(List,new Comparator<DTO>(){
@Override
public int compare(DTO o1,
DTO o2) {
Integer runTimeO1 = Integer.parseInt(o1.getRunTime());
Integer runTimeO2 = Integer.parseInt(o2.getRunTime());
//按照运行时间进行排列
return runTimeO2.compareTo(runTimeO1);
// 降序
// return b.compareTo(a);
}
});
Collections.sort(List,new Comparator<DTO>(){
@Override
public int compare(DTO o1,
DTO o2) {
Integer runTimeO1 = Integer.parseInt(o1.getRunTime());
Integer runTimeO2 = Integer.parseInt(o2.getRunTime());
//按照运行时间进行排列
return runTimeO2.compareTo(runTimeO1);
// 降序
// return b.compareTo(a);
}
});