I have a
Map
What is the best way to keep the map sorted according to the float?
Is SortedMap
TreeMap sorts by the key natural ordering. The keys should implement Comparable or be compatible with a Comparator (if you passed one instance to constructor). In you case, Float already implements Comparable so you don't have to do anything special.
You can call keySet to retrieve all the keys in ascending order.