How do I retrieve the values of a Hashtable/HashMap in sorted order?
Location: http://www.jguru.com/faq/view.jsp?EID=503126 Created: Sep 25, 2001 Modified: 2001-11-29 22:45:37.037 Author: John Zukowski (http://www.jguru.com/guru/viewbio.jsp?EID=7) Question originally posed by Ajay Tejwani (http://www.jguru.com/guru/viewbio.jsp?EID=418246 Basically, you can’t directly do this. What you can do is get the Collection of values() back from the map and create a sorted collection, or maintain two maps, one in each direction, and keep the second map sorted by being a TreeMap. Which you use depends on the frequency you must sort the elements.