Util
Class PairSorter

java.lang.Object
  extended by Util.PairSorter

public class PairSorter
extends java.lang.Object

Provides some methods that utilize Pair to quickly return sorted values

Author:
davidc

Constructor Summary
PairSorter()
           
 
Method Summary
static
<K,V extends java.lang.Comparable>
java.util.List<K>
getKeysSortedByValue(java.util.Map<K,V> map, boolean sortAscending)
           
static
<K,V extends java.lang.Comparable>
K
getMostFrequent(java.util.Map<K,V> map)
           
static
<K extends java.lang.Comparable,V extends java.lang.Comparable>
java.util.List<Pair<K,V>>
getPairsSortedByValue(java.util.Map<K,V> map, boolean sortAscending)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PairSorter

public PairSorter()
Method Detail

getKeysSortedByValue

public static <K,V extends java.lang.Comparable> java.util.List<K> getKeysSortedByValue(java.util.Map<K,V> map,
                                                                                        boolean sortAscending)

getPairsSortedByValue

public static <K extends java.lang.Comparable,V extends java.lang.Comparable> java.util.List<Pair<K,V>> getPairsSortedByValue(java.util.Map<K,V> map,
                                                                                                                              boolean sortAscending)

getMostFrequent

public static <K,V extends java.lang.Comparable> K getMostFrequent(java.util.Map<K,V> map)