Set<Map.Entry<String, Float>> set = map.entrySet();
Map.Entry[] entries = (Map.Entry[]) set.toArray(new Map.Entry[set
.size()]);
Arrays.sort(entries, new Comparator() {
public int compare(Object arg0, Object arg1) {
Float key1 = (Float) ((Map.Entry) arg0).getValue();
Float key2 = Float.valueOf(((Map.Entry) arg1).getValue()
.toString());
return key1.compareTo(key2);
}
});
Map.Entry[] entries = (Map.Entry[]) set.toArray(new Map.Entry[set
.size()]);
Arrays.sort(entries, new Comparator() {
public int compare(Object arg0, Object arg1) {
Float key1 = (Float) ((Map.Entry) arg0).getValue();
Float key2 = Float.valueOf(((Map.Entry) arg1).getValue()
.toString());
return key1.compareTo(key2);
}
});