commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stephen Colebourne" <scolebou...@btopenworld.com>
Subject Re: [collections] Re: BoundedCollection
Date Sun, 24 Nov 2002 16:29:24 GMT
BoundedCollection has been added to CVS. I added the maxSize method
originally suggested, as I wanted that done before the interface gets
'frozen'. If there are any more 'bounded' methods let us know.

I put the static methods on CollectionUtils, to allow for non-buffer
implementations of BoundedCollection.

thanks
Stephen

----- Original Message -----
From: "Herve Quiroz" <herve.quiroz@esil.univ-mrs.fr>
> Here is the patch.
>
> bounded-support.diff:
> patch file for BufferUtils.java and BoundedFifoBuffer.java
>
> BoundedCollection.java:
> new file
>
> I have tried to find a way of including the new file in the diff but
> there's nothing about it on the Jakarta project "Getting involved" web
> page (at least I didn't see any).
>
> Sorry, no unit test :( I know I should have done so but I wouldn't have
> learnt JUnit just for a small patch. Anyway, I will have to learn it so
> hopefuly I will provide unit tests with my next contribution :)
>
> But it works AFAIK, with support for SynchronizedBuffers also.
>
> Regards,
>
>
> -Herve
>
> On Thu, 14 Nov 2002, Stephen Colebourne wrote:
>
> > I like this idea, and can see no problems with implementation. Would you
> > like to code it up as a new interface and patches to existing files
(from
> > CVS head) ? Its the best way to get it included ;-)
> >
> > In addition you could add convenience static methods to BufferUtils to
do
> > this code
> >
> > public static boolean isFull(Buffer buffer) {
> >  if (myBuffer instanceof BoundedCollection)
> >      bufferFull=((BoundedCollection)myBuffer).isFull();
> >  else
> >      bufferFull=false; // as long as there is some free memory left
> > }
> > (and also maxsize)
> >
>


--
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