| Constructor and Description |
|---|
MapUtils() |
| Modifier and Type | Method and Description |
|---|---|
static <K,V> String |
asTSV(Map<K,V> map)
Return map in TSV format.
|
static <K,V> String |
asTSV(Map<K,V> map,
String keyHeader,
String valueHeader)
Return map in TSV format.
|
static <K,V> com.google.common.collect.Multimap<K,V> |
createMultiMap(Map<K,? extends Iterable<V>> input)
Constructs a multimap with the same mappings as the specified map.
|
static <K extends Comparable,V extends Comparable> |
createSortedMultiMap(Map<K,? extends Iterable<V>> input)
Creates a Guava sorted multimap using the input map.
|
static <K,V extends Comparable<V>> |
sortByValues(Map<K,V> map)
Returns a list of entries sorted by the map values descending.
|
static <K,V extends Comparable<V>> |
sortByValues(Map<K,V> map,
boolean ascending)
Returns a list of entries sorted by the map values either ascending or descending.
|
public MapUtils()
public static <K,V extends Comparable<V>> List<Map.Entry<K,V>> sortByValues(Map<K,V> map)
map - the mappublic static <K,V extends Comparable<V>> List<Map.Entry<K,V>> sortByValues(Map<K,V> map, boolean ascending)
map - the mappublic static <K,V> com.google.common.collect.Multimap<K,V> createMultiMap(Map<K,? extends Iterable<V>> input)
input - the input mappublic static <K extends Comparable,V extends Comparable> com.google.common.collect.Multimap<K,V> createSortedMultiMap(Map<K,? extends Iterable<V>> input)
input - the input mappublic static <K,V> String asTSV(Map<K,V> map)
K - V - map - the map
DL-Learner is licenced under the terms of the GNU General Public License.
Copyright © 2007-2019 Jens Lehmann