commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Morgan Delagrange" <mdela...@yahoo.com>
Subject Re: [Collections] subclassing LRUMap
Date Thu, 14 Feb 2002 21:40:17 GMT
Right, when put(Object,Object) operations will exceed the maximum size of
the Map, the class internally calls removeLRU().

----- Original Message -----
From: "Aaron Smuts" <ASmuts@therealm.com>
To: "Jakarta Commons Developers List" <commons-dev@jakarta.apache.org>
Sent: Thursday, February 14, 2002 3:26 PM
Subject: RE: [Collections] subclassing LRUMap


> You need a special removal for overflow since you don't want to spoll
normal
> removals to disk.  The LRU implementation in stratum allows you to do
this.
>
> > -----Original Message-----
> > From: Morgan Delagrange [mailto:mdelagra@yahoo.com]
> > Sent: Thursday, February 14, 2002 4:13 PM
> > To: Jakarta Commons Developers
> > Subject: [Collections] subclassing LRUMap
> >
> > Hi all,
> >
> > I just made a backward-compatible change to LRUMap to facilitate
> > subclassing.  Now, you can override removeLRU() if you want to
manipulate
> > (e.g. persist to disk) an Object before it is automatically removed from
> > the
> > Map.  You can also subclass remove(Object) if you want to manipulate all
> > Objects before they are removed, whether or not they are being removed
by
> > the LRU algorithm.
> >
> > This seemed like a pretty reasonable thing to do, but I wanted to drop a
> > note to the list since it enhances the contract of LRUMap.  Let me know
if
> > you object to the idea or the approach.
> >
> > I also added a couple of unit tests (TestLRUMap.java) that confirm the
> > ability of subclasses to control Object removal.
> >
> > - Morgan
> >
> >
> > _________________________________________________________
> > Do You Yahoo!?
> > Get your free @yahoo.com address at http://mail.yahoo.com
> >
> >
> > --
> > To unsubscribe, e-mail:   <mailto:commons-dev-
> > unsubscribe@jakarta.apache.org>
> > For additional commands, e-mail: <mailto:commons-dev-
> > help@jakarta.apache.org>
>


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message