How can I retrieve the items in my HashSet / HashMap in the order they were added?
Location: http://www.jguru.com/faq/view.jsp?EID=456424 Created: Jul 17, 2001 Author: John Zukowski (http://www.jguru.com/guru/viewbio.jsp?EID=7) Prior to Java 1.4, you had to manage a separate insertion order list yourself. Starting with Java 1.4, you can use the new LinkedHashMap / LinkedHashSet classes. The iterators you get back from them return the items in insertion order.