Re: [DISCUSSION] LinkedHashMap iteration order.

2007-07-30 Thread Paulo Levi
Well. I've solved it independently hacking a hashmap that also maintains its access order in a LinkedList in the get, put and remove calls. A pity about the remove being o(n) but i couldn't find a way to iterate over the LinkedHashSet in reverse order (which was kinda the point anyway, since Linked

[DISCUSSION] LinkedHashMap iteration order.

2007-07-25 Thread Paulo Levi
The LinkedHashMap seems like a nice class for implementing a LRU map, and it is. However when you try to use it to actually access the most recently used with the appropriate constructor, its easy to see that the order of iteration is from the least recently used to the most recently used. To ac