public static List < Entry > sortHashTable ( final Hashtable < ? , ? > hash , final boolean asc ) { // Put keys and values in to an arraylist using entryset final ArrayList < Entry > myArrayList = new ArrayList ( hash . entrySet ( ) ) ; // Sort the values based on values first and then keys. Collections . sort ( myArrayList , new HashComparator ( asc ) ) ; return myArrayList ; }
Sort hash table .