commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael A. Smith" <>
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".


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


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[]).  


To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message