public static < K > Map < K , Integer > rankMapOnIntegerValue ( Map < K , Integer > inputMap ) { Map < K , Integer > newMap = new TreeMap < K , Integer > ( new IntegerValueComparator ( inputMap ) ) ; newMap . putAll ( inputMap ) ; Map < K , Integer > linkedMap = new LinkedHashMap < K , Integer > ( newMap ) ; return linkedMap ; }
Ranks a map based on integer values