You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Morgan Delagrange <md...@yahoo.com> on 2002/02/19 22:09:19 UTC

[collections] unclear contract for LRUMap.setMaximumSize(int)

Hi all,

This is strange.  What is the proper behaviour of the
LRUMap.setMaximumSize(int) method, do you think?  One would assume that, if
the current LRUMap has more keys than the new maximum size, the LRUMap would
trim excess keys according to the LRU algorithm.  But right now, all it
appears to do is maintain the current size.  The Javadocs do not indicate
one way or the other.

- Morgan


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


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: [collections] unclear contract for LRUMap.setMaximumSize(int)

Posted by Michael Smith <mi...@iammichael.org>.
James Strachan wrote: 
> 
> ----- Original Message -----
> From: "Morgan Delagrange" <md...@yahoo.com>
> > Hi all,
> >
> > This is strange.  What is the proper behaviour of the
> > LRUMap.setMaximumSize(int) method, do you think?  One would 
> assume that,
> if
> > the current LRUMap has more keys than the new maximum size, 
> the LRUMap
> would
> > trim excess keys according to the LRU algorithm.  But right 
> now, all it
> > appears to do is maintain the current size.  The Javadocs 
> do not indicate
> > one way or the other.
> 
> I guess since its vague right now this could go either way :)
> 
> My gut feel is with the former, that the map shrinks if the 
> new max size is
> smaller than the currrent size.

+1 -- I agree with this perception.  

michael


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [collections] unclear contract for LRUMap.setMaximumSize(int)

Posted by James Strachan <ja...@yahoo.co.uk>.
----- Original Message -----
From: "Morgan Delagrange" <md...@yahoo.com>
> Hi all,
>
> This is strange.  What is the proper behaviour of the
> LRUMap.setMaximumSize(int) method, do you think?  One would assume that,
if
> the current LRUMap has more keys than the new maximum size, the LRUMap
would
> trim excess keys according to the LRU algorithm.  But right now, all it
> appears to do is maintain the current size.  The Javadocs do not indicate
> one way or the other.

I guess since its vague right now this could go either way :)

My gut feel is with the former, that the map shrinks if the new max size is
smaller than the currrent size.

James


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>