Collections.sort(ghEntityList, new Comparator<GongHuiEntity>() {
  @Override
  public int compare(GongHuiEntity o1, GongHuiEntity o2) {
  if (o1 == null || o2 == null) {
    return 0;
  }  
  //第一次比较等级
  int i = o2.getGongHuiModel().getLevel() - o1.getGongHuiModel().getLevel();
  //如果等级相同比较经验
  if(i == 0){
    int o1Exp = o1.getGongHuiModel().getExp();
    int o2Exp = o2.getGongHuiModel().getExp();
    int j = o2Exp - o1Exp;
    return j;
  }
  return i;
  }
});

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-01
  • 2021-11-17
  • 2022-12-23
  • 2022-01-15
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-01-07
  • 2022-12-23
  • 2021-12-03
  • 2021-12-04
  • 2021-08-19
相关资源
相似解决方案