There doesn't really exist any data structure that could do this efficiently: you have to maintain a data structure that makes it efficient to look up by keys, and sorting the values makes it more difficult to maintain that structure.
If you don't modify the map after it's created, though, then you could do something like this:
List> list = new ArrayList>(
map.entrySet());
Collections.sort(list, new Comparator>() {
public int compare(Map.Entry e1, Map.Entry e2) {
return e1.getValue().compareTo(e2.getValue());
}
});
Map sortedByValues = new LinkedHashMap();
for (Map.Entry entry : list) {
sortedByValues.put(entry.getKey(), entry.getValue());
}
The resulting LinkedHashMap would iterate in sorted value order.