File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes Ordered Collection Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Ordered Collection" Watch "Ordered Collection" New topic

Ordered Collection

surendar prabu
Ranch Hand

Joined: Jul 24, 2006
Posts: 102
I need to maintain key-value pairs. I need to stre them in an ordered manner.say if i insert the elements as


I want to retrieve them in the same order as inserted. Also i dont want them to be sorted. I need only ordered key value pairs.
How can i achieve this?

Surendar prabu
[ August 01, 2007: Message edited by: surendar prabu ]

SCJP 1.4
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
Check out the JavaDoc for LinkedHashMap.

Consultant, Sima Solutions
surendar prabu
Ranch Hand

Joined: Jul 24, 2006
Posts: 102
Thanks Merill. I have got what i needed.
I agree. Here's the link:
subject: Ordered Collection
It's not a secret anymore!