对集合的操作
> 对Set集合的排序操作
Set<Long> keySet = map.keySet();
List<Long> arrayList = new ArrayList<>(keySet);
Collections.sort(arrayList, new Comparator<Object>() { @Override public int compare(Object o1, Object o2) { Long time1 = (Long) o1; Long time2 = (Long) o2; if(time1 - time2 > 0){ return -1; }else{ return 0; } } });
本文来自博客园踩坑狭,作者:韩若明瞳,转载请注明原文链接:https://www.cnblogs.com/han-guang-xue/p/12931636.html