Map<Integer, String> allCountryMap = tripPlaceManager.getAllCountryMap();
List<Map.Entry<Integer, String>> countryList = new ArrayList<Map.Entry<Integer, String>>(allCountryMap.entrySet());
Collections.sort(countryList, new Comparator<Map.Entry<Integer, String>>() {
public int compare(Map.Entry<Integer, String> obj1, Map.Entry<Integer, String> obj2) {
return obj1.getValue().compareTo(obj2.getValue());
}
});
Map根据值排序
最新推荐文章于 2024-05-30 08:34:38 发布