For a project, I wanted to use THashMap, but I needed to preserve insertion order of the entries when iterating. With the addition of an int field to THashMap and several method overrides, insertion order is preserved a la LinkedHashMap.
The attachment is a .zip with two files: THashMapOrderedByInsert.java, and a test class copy-wasted from THashMapTest.java in 2.0.4 src distribution.
Is there a planning to adopt this one in release? I'm trying to adopt trove4j for an existing project, while there is a requirement of iterating linkedhashmap through insertion order..
@ralphsu You could use the one attached to this bug and let us know your experiences. It hasn't gone through extensive testing yet (which is why it isn't in the main code base yet).
I did try the attached one. With the latest code, it seems some of the class not found in the main code base like TObjectHashStrategy which is referenced in one of the constructor.
By eliminate the not found class, the attachment works find to me. Insertion order was preserved, but i had to say that i haven't do more testing like performance or memory usage testing. It now passed through all my test cases including those rely on the insertion order.
I also have the same requirement. Tried the attached one but I am getting compilation issues with 3.1a1. How to resolve it?
This isn't supported at the moment, so it's not something I can help with. Looks like @ralphsu got it working so maybe he could help.
If can't really be accepted into the main distribution until it's had some performance review. At some point I'm planning to have an "experimental" module which it could be pulled into.
Thanks Rob Eden!
Can you please help me here?