| Author |
question on Map for 1.3
|
pradeep arum
Ranch Hand
Joined: Oct 01, 2003
Posts: 130
|
|
Hi all, my question is, like LinkedHashMap for jdk1.4 which preserves the insertion order, is there any class in jdk1.3?, if there is not!!! what is the best way to simulate an insertion order preserving Map with key-value pairs.my project uses currently 1.3, I can not go for 1.4 thanks pradeep
|
SCJP1.4,SCBCD
Failure is not when you fall down; its only when you fail to get up again.
|
 |
Jeff Langr
author
Ranch Hand
Joined: May 14, 2003
Posts: 758
|
|
Create a class that encapsulates a map and an ordered list (ArrayList). Stores the keys in the list object and ensure that it stays synchronized with the map. -Jeff-
|
Author, Agile Java, Essential Java Style. Agile in a Flash. Contributor, Clean Code.
|
 |
Jim Yingst
Wanderer
Sheriff
Joined: Jan 30, 2000
Posts: 18670
|
|
|
It looks like Jakarta Commons Collections already has a couple classes that do this. I expect they should work in 1.3, as they don't seem to use 1.4-specific code. Check out ListOrderedMap and LinkedMap.
|
"I'm not back." - Bill Harding, Twister
|
 |
 |
|
|
subject: question on Map for 1.3
|
|
|