You don't want to use a Hash to store your items. Use an ArrayList instead. Create an object to store name-value pairs and use it to store the values in the ArrayList. You might also want to subclass the ArrayList and provide some of the methods contained in the Map Interface. You might want to overload the get() method to return the value in the ArrayList given a key. You also need to think about how to handle duplicates.
Regards, Richard At 10:21 AM 11/22/2002 +0530, Lakshmeenarayana G G wrote:
Hi, I am using Hashtable or HashMap to keep Key-Value pair of elements. But When I add them, The Hashtable or HashMap gets sorted depending on the keys. I want to retain the order in which I have added the key-value pair. Is there anyway to do it with Hashtable or HashMap ? Or Can I use any other Collection type which will have the mapping of key-value which is not sorted other than two dimensional Array. Thanks for the time. Lakshmeenarayana G G CLI Division - SysArris Software Bangalore - India Tel. No. +91-80-665 4965, 665 5052, 664 2690 Xtn-240 Fax No. +91-80-665 0374, 655 4285 http://www.sysarris.com/ =========================================================================== To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST". For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST". Some relevant FAQs on JSP/Servlets can be found at: http://archives.java.sun.com/jsp-interest.html http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.jsp http://www.jguru.com/faq/index.jsp http://www.jspinsider.com
=========================================================================== To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST". For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST". Some relevant FAQs on JSP/Servlets can be found at: http://archives.java.sun.com/jsp-interest.html http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.jsp http://www.jguru.com/faq/index.jsp http://www.jspinsider.com