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 collections
Date Mon, 14 Oct 2002 22:14:55 GMT
On Mon, 14 Oct 2002, Stephen Colebourne wrote:
> A debate has recently arrived at my doors privately from Bruce Eckel related
> to the primitive collections:
> 
> Bruce has argued that the primitive method names should be the same as the
> Object ones from List, and the primitive classes should thus not implement
> List but a new interface PrimitiveIntList etc.
> 
> Due to the current freeze on [collections] for release and need for a
> release, I (as release manager) have decided to restrict debate on this and
> proceed with the primitive collections as is.
> 
> Any objections??

no objections.  We've discussed a separate interface for these 
collections that could be added later.  Having a PrimitiveIntList 
interface would be fairly simple to add in with a later release without 
any backwards compatibility issue since all the primitive methods 
already exist.  

Unless, of course, the collection views (subList in the case of the 
Lists) must return the PrimitiveIntList interface rather than a generic 
List.  That becomes much more complicated, and flirts with the limit, in 
my opinion, of complexity over usefulness.

search a mail archive for the subject "[Collections] primitive pkg - was 
"Release potential?"" for the previous mail thread.  mail-archive 
doesn't have it 'cause it was have having problems archiving at the 
time.  You can view the thread on eyebrowse though:
http://archives.apache.org/eyebrowse/SearchList?listId=&listName=commons-dev%40jakarta.apache.org&searchText=Collections+primitive+pkg+was+Release+potential&defaultField=subject&Search=Search

regards,
michael

> 
> Stephen
> 
> 
> Original debate:
> ----- Original Message -----
> From: "Bruce Eckel" <Bruce@EckelObjects.com>
> > I think you should implement a parallel interface hierarchy:
> > PrimitiveCollection, PrimitiveList, PrimitiveSet, PrimitiveMap. I
> > think it's a lot more important to have the same method names as
> > the Java collection hierarchy.
> >
> > *********** REPLY SEPARATOR  ***********
> >
> > On 10/14/2002 at 5:46 PM scolebourne@btopenworld.com wrote:
> >
> > >The reason for the method names is that the classes implement the
> > List
> > >interface (returning Integer objects). Clearly a different method
> > name is
> > >required as int and Object are incompatable types.
> > >
> > >At present, we have lists for most primitive types. We do not have
> > Map
> > >implementations however, and this will hopefully be addresed by
> > someone
> > >soon.
> > >
> > >Stephen
> > >
> > >>  from:    Bruce Eckel <Bruce@EckelObjects.com>
> > >>
> > >> Any hope for review/refactoring on these things? For example,
> > the
> > >> IntArrayList uses 'Int' everywhere in its method names. For
> > >> example:
> > >> addInt(), getInt(), containsInt(), indexOfInt(), and on.
> > >> why not just follow the existing container library rather than
> > >> forcing people to learn something new and redundant? e.g.:
> > >> add(), get(), contains(), indexOf()
> > >> If I create a container of int, then that's what I expect to
> > add()
> > >> and get().
> > >>
> > >> *********** REPLY SEPARATOR  ***********
> > >>
> > >> On 10/14/2002 at 8:28 AM Henri Yandell wrote:
> > >>
> > >> >Have a look at:
> > >> >
> > >>
> > >http://cvs.apache.org/viewcvs.cgi/jakarta-commons/collections/src/j
> >
> > >> ava/org/apache/commons/collections/primitives/
> > >> >
> > >> >Stephen Colebourne's preparing a new release of Collections.
> > >> Stephen, will
> > >> >the primitives be going in that release?
> > >> >
> > >> >Hen
> > >> >
> > >> >[just caught James' reply, so will limit this going to
> > everyone.
> > >> The link
> > >> >above is the code in cvs James mentions]
> > >> >
> > >> >On Mon, 14 Oct 2002, Bruce Eckel wrote:
> > >> >
> > >> >> As I was working on "Thinking in Java, 3rd edition" I read
> > the
> > >> part
> > >> >> about how collections don't handle primitive types. It also
> > >> appears
> > >> >> that this will *not* be addressed with Generics in JDK 1.5 --
> > >> that
> > >> >> is, Generics will only handle objects and will not be able to
> > be
> > >> >> instantiated for primitives, as templates can be with C  .
> > >> >>
> > >> >> Have you thought about creating versions of the Collections
> > for
> > >> >> primitive types?
> 
> 
> 
> --
> To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>
> 



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