Class MapUtil
java.lang.Object
MapUtil
Utilities for working with Java maps (dictionaries).
For theory, see: https://en.wikipedia.org/wiki/Associative_array
- Since:
- 2017-08-02
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription(package private) static <K,
V extends Comparable<? super V>>
SortedSet<Map.Entry<K,V>> entriesSortedByValues
(Map<K, V> map, boolean reverse) Return a SortedSet of a Map based on Comparable values.static void
Main test method.
-
Constructor Details
-
MapUtil
public MapUtil()
-
-
Method Details
-
entriesSortedByValues
static <K,V extends Comparable<? super V>> SortedSet<Map.Entry<K,V>> entriesSortedByValues(Map<K, V> map, boolean reverse) Return a SortedSet of a Map based on Comparable values. From: https://stackoverflow.com/questions/2864840/treemap-sort-by-value -
main
Main test method.
-