zoukankan      html  css  js  c++  java
  • 关于List排序

    这里关于List的排序:

    public class ZtListSortUtil {
    public static List<ApocalypseZtProductRO> getListSort (List<ApocalypseZtProductRO> a){
    Collections.sort(a, new Comparator<ApocalypseZtProductRO>() {
    public int compare(ApocalypseZtProductRO arg0, ApocalypseZtProductRO arg1) {
    int hits0 = arg0.getCount();
    int hits1 = arg1.getCount();
    if (hits1 < hits0) {
    return 1;
    } else if (hits1 == hits0) {
    return 0;
    } else {
    return -1;
    }
    }
    });
    return a;
    }
    }
  • 相关阅读:
    11.29
    11.28
    11.24
    11.21
    11.17
    11.15
    11.14
    11.9
    11.5
    11.3
  • 原文地址:https://www.cnblogs.com/April-Chou-HelloWorld/p/6635315.html
Copyright © 2011-2022 走看看