list集合对象日期排序

1.Collections.sort排序
 List<DateObj> list = mongoDAO.findByQuery(query,DateObj.class);
        Collections.sort(list, new Comparator<DateObj>() {
            @Override
            public int compare(DateObjo1, DateObjo2) {
                if(o1.getEntryTime()-o2.getEntryTime()==0)
                    return 0;
                return o1.getEntryTime()-o2.getEntryTime()>0?-1:1;
            }
        });
//EntryTime自动为long
原文地址:https://www.cnblogs.com/free-discipline/p/15428462.html