You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by "Waldhoff, Rodney" <rw...@us.britannica.com> on 2002/05/28 14:47:34 UTC

[collections] collections of primitives?

Over at the AxionDB project (http://axion.tigris.org/) we've created a
handful of ArrayList-like collections that store primitives (for space
efficiencies), support primitive method signatures like indexOfInt(int) (for
time efficiencies), but otherwise support the List interface (for
interoperability).  

The space savings is substantial.  For example, a ShortArrayList requires
1/10th the memory of an ArrayList of Short values (or a Short[]).  A
LongArrayList requires 2/5ths the memory or an ArrayList of Longs (or a
Long[]). 

Someday (JDK1.5?) these will likely be superceded by Java-generics (indeed,
they make a good case for Java-generics).

If there are no complaints, I'd like to add these to commons-collections,
probably packaged as org.apache.commons.collections.primitives (to make room
for additional primitive-collections implementations and avoid additional
crowding in org.apache.commons.collections.*). I've already got karma, I
just thought I'd see if anyone complains or has a better packaging
suggestion first.  You can browse the code at
http://axion.tigris.org/source/browse/axion/whiteboard/one/src/org/axiondb/u
til/

 - Rod

Re: [collections] collections of primitives?

Posted by Stephen Colebourne <sc...@eurobell.co.uk>.
I've taken a quick look, and I like them :-)

I would agree that a separate subpackage seems appropriate for these
collections.

Stephen

----- Original Message -----
From: Waldhoff, Rodney <rw...@us.britannica.com>
To: 'Jakarta Commons Developers List' <co...@jakarta.apache.org>
Sent: Tuesday, May 28, 2002 1:47 PM
Subject: [collections] collections of primitives?


> Over at the AxionDB project (http://axion.tigris.org/) we've created a
> handful of ArrayList-like collections that store primitives (for space
> efficiencies), support primitive method signatures like indexOfInt(int)
(for
> time efficiencies), but otherwise support the List interface (for
> interoperability).
>
> The space savings is substantial.  For example, a ShortArrayList requires
> 1/10th the memory of an ArrayList of Short values (or a Short[]).  A
> LongArrayList requires 2/5ths the memory or an ArrayList of Longs (or a
> Long[]).
>
> Someday (JDK1.5?) these will likely be superceded by Java-generics
(indeed,
> they make a good case for Java-generics).
>
> If there are no complaints, I'd like to add these to commons-collections,
> probably packaged as org.apache.commons.collections.primitives (to make
room
> for additional primitive-collections implementations and avoid additional
> crowding in org.apache.commons.collections.*). I've already got karma, I
> just thought I'd see if anyone complains or has a better packaging
> suggestion first.  You can browse the code at
>
http://axion.tigris.org/source/browse/axion/whiteboard/one/src/org/axiondb/u
> til/
>
>  - Rod
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>