我在笔记应用中有以下代码。笔记按键排序。 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());