public class MapSorter
extends java.lang.Object
Constructor and Description |
---|
MapSorter() |
Modifier and Type | Method and Description |
---|---|
static <K,V extends java.lang.Comparable<? super V>> |
sortByValue(java.util.Map<K,V> map)
This method is to sort a map by its value in ascending way.
|
public static <K,V extends java.lang.Comparable<? super V>> java.util.Map<K,V> sortByValue(java.util.Map<K,V> map)
K
- - the data type of Key of a MapV
- - the data type of Value of a Mapmap
- - Map
Map