list通过比较器进行排序

  Collections.sort(dataList,new Comparator<BaseTransitData>(){
            public int compare(BaseTransitData arg0, BaseTransitData arg1) {
                return arg0.getTransitcode().compareTo(arg1.getTransitcode());
            }
        });   

posted @ 2015-05-07 10:34  深呼吸000  阅读(705)  评论(0编辑  收藏  举报