commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stephen Colebourne <scolebou...@btopenworld.com>
Subject Re: OrderedMapIterator and LRUMap
Date Fri, 13 Jul 2007 23:06:36 GMT
Hayden James wrote:
> Now if I use synchronizedMap, which forces me to use the Map interface 
> like:
> Map map = Collections.synchronizedMap(new LRUMap());
> 
> which iterator from which function do I cast in order to get the same
> behavior as above?
> OrderedMapIterator iter = (OrderedMapIterator) map.entrySet().iterator();
> or maybe
> OrderedMapIterator iter = (OrderedMapIterator) map.keySet().iterator();
> 
> or perhaps something completely different.  The documentation is a little
> vague on how to accomplish this.

Once you wrap the LRUMap in a synchronized map there is no way to obtain 
the ordered iterator.

Stephen

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message