commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael A. Smith" <...@apache.org>
Subject RE: [Commons-Avalon:collections] code integration
Date Thu, 20 Jun 2002 17:44:23 GMT
On Thu, 20 Jun 2002, Jack, Paul wrote:
> > The remove(Object), remove(Collection), and retain(Object)
> > methods are optional to implement.  I *highly* recommend not
> > implementing them.
> > 
> > The added complexity and memory requirements required for
> > array copying don't outweigh the benefit of using a Buffer/Queue
> > they way it was designed to be used.
> 
> Um, who said anything about array copying?  Perhaps I should 
> show some code, that might clear up what I'm getting at...

I thought you did:

On Thu, 20 Jun 2002, Jack, Paul wrote:
> Iterator.remove() would have to completely recopy the
> internal array and reset the head and tail.  Again, it'd
> be extremely slow -- but wouldn't affect the add() and remove()
> implementations.


> > Having looked at the JavaDocs for both Collection and Iterator,
> > I believe that the Buffer/Queue should choose not to allow the
> > optional remove() methods.  As per the contract, they would
> > throw an OpperationUnsupportedException by design.
> > 
> > Their support causes more issues than they solve.
> 
> I really don't see how their support causes *any* issues.

And I don't see why the *optional* operations *need* to be supported. 

regards,
michael


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