Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Java in General and the fly likes What is a data structure for Map that preserves insert order? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "What is a data structure for Map that preserves insert order?" Watch "What is a data structure for Map that preserves insert order?" New topic
Author

What is a data structure for Map that preserves insert order?

Dave Alvarado
Ranch Hand

Joined: Jul 02, 2008
Posts: 436
Hi,

I'm using Java 1.6. Is there a data structure similar to Map (or implementation of Map) that will preserve the order in which I insert elements via

map.put(key1,value1)
map.put(key2,value2);
map.put(key3,value3)

? Ultimately I am looking to get back a list of Map.Entry<Object, Object> objects from the aforementioned data structure.

Thanks, - Dave
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 63222
    
  69

LinkedHashMap


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: What is a data structure for Map that preserves insert order?
 
It's not a secret anymore!