0
我在记笔记应用程序中使用了以下代码。笔记按键排序。 TreeSet放置最早的第一个。我想做相反的事情。使用哪个类?如果TreeSet安排从最旧到最新的数据,他们将从最新到最旧的数据排序。
//retrieve data, map unordered data collection with a key and a value
Map<String, ?> notesMap = notePrefs.getAll();
//get a list of all the keys of the notes, keySet-return all Keys without order, TreeSet-sorts data
SortedSet<String> keys =new TreeSet<String>(notesMap.keySet());