commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael A. Smith" <...@apache.org>
Subject RE: [Collections] primitive pkg - was "Release potential?"
Date Mon, 19 Aug 2002 21:57:37 GMT
On Mon, 19 Aug 2002, Waldhoff, Rodney wrote:
> I concur with the notion adding the interfaces IntList, FloatList, etc.

I don't yet see the value in the interfaces.  

> I'd discourage simply renaming Abstract*ArrayList to Abstract*List as they
> currently stand.  Some of the methods there (e.g., ensureCapacity, capacity,
> trimToSize) don't make sense for Lists in general--they really do imply some
> sort of sequential-block-of-memory, array-like storage. I'll argue that
> Abstract*ArrayList's place in the hierarchy is more analagous to
> AbstractSequentialList (although for random-access, array-like structures
> rather than sequential-access, linked list-like structures.)  I guess we
> could call them AbstractRandomAccess*List if you wanna be more generic, as
> I'd suppose most random access oriented structures would share some notion
> of "capacity".

Agreed.  

I think a good approach would be to just remove the methods that assume 
an implementation method.  Specifically, remove:

 capacity()
 ensureCapacity(int)
 trimToSize()

Then, the AbstractIntList really is an AbstractIntList and can be used 
in the same way by both sequential and random access implementations.

I don't think an AbstractXArrayList that just adds the above three 
methods is really necessary unless it's going to add some basic 
implementation, but there's no basic implementation that can be written 
that's applicable for all implementations of a random access list (e.g. 
compare an int list stored in a random access file, in a jdk 1.4 
java.nio.Intbuffer,  or in a byte[]).  

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