i have the following TreeMap:
TreeMap<Integer, Double> map;
the Double values are not unique.
i iterate through the map using Integer keys and the functions firstEntry() and higherEntry() and modify the Double values.
Now i want to list the values of the pairs in the order of decreasing Double values. what is the best way to do this?
those Integer keys are important to me and because the Double values are not unique, i cannot have a Double key.
Update: More Explanation it is the classic problem. lets say rollnos of students is the key and their percentage is the value. now sort by percentage and then we should be able to tell whose percentage is it. therefore i need the integer key.