Skip to content

Instantly share code, notes, and snippets.

@edipofederle
Created July 2, 2014 15:57
Show Gist options
  • Save edipofederle/cf8b4ca6901cc308f3a5 to your computer and use it in GitHub Desktop.
Save edipofederle/cf8b4ca6901cc308f3a5 to your computer and use it in GitHub Desktop.
sortMap.java
Ordering<Map.Entry<String, Double>> byMapValues = new Ordering<Map.Entry<String, Double>>() {
@Override
public int compare(Map.Entry<String, Double> left, Map.Entry<String, Double> right) {
return left.getValue().compareTo(right.getValue());
}
};
List<Map.Entry<String, Double>> edsValues = Lists.newArrayList(resultsEds.entrySet());
Collections.sort(edsValues, byMapValues);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment