Posted By:
Christopher_Schultz
Posted On:
Thursday, May 24, 2001 08:20 AM
Well, you can't sort a hashtable, but you can get all of the values in a hashtable and sort THEM.
Collection values = hashtable.values();
LinkedList list = new LinkedList(values);
list = Collections.sort(list);
You now have a sorted list of your values. Note that the values are still not sorted in the hashtable, since that doesn't make any sense. Only the list we created has any notion of 'order'.
-chris