How to retrieve all values from a HashMap in the order you put them in ?
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   wim_creten
Posted On:   Monday, June 30, 2003 04:17 AM

Yooooo guys,

I am having a HashMap here. Now I want to retrieve all the values from it. But I want to retrieve them in the order in which I put them in. Is this possible in an easy way ?


Cheers,
Wim

Re: How to retrieve all values from a HashMap in the order you put them in ?

Posted By:   Andrew_York  
Posted On:   Tuesday, July 29, 2003 01:33 PM

LinkedHashMap. Added in JDK 1.4.

Re: How to retrieve all values from a HashMap in the order you put them in ?

Posted By:   James_Page  
Posted On:   Monday, June 30, 2003 05:14 AM

Yes you can, but not with the standard set of collections classes provided as part of the standard Java API.



The Jakarta Commons Collections component provides a SequencedHashMap class that implements the standard Map interface that should provide the functionality that you require.



Cheers



James

About | Sitemap | Contact