commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rodney Waldhoff <rwaldh...@apache.org>
Subject RE: [primitives] Looking for a primitive hashtable
Date Tue, 30 Mar 2004 21:48:17 GMT
On Tue, 30 Mar 2004, Tatu Vanhanen wrote:

> > Your search is likely to be in vain ... primitives like "int" in Java
> > are not actually objects.  The best you can do is make your keys
> > instances of the corresponding wrapper classes (like java.lang.Integer)
> > if you want to actually implement the java.util.Map contract.
> >
> > It's possible that the auto-boxing features in JDK 1.5 can create a
> > convincing simulation that you're really using primitives as keys, but
> > under the covers it will still be using wrapper objects even there.
> >
> > Craig
>
> The above is certainly true, but despite of possibly being not compatible
> with java.util.Map- interface, a dedicated primitive-keyed (or valued) map
> would be powerful (meaning requiring less space and having better
> performance) in many situations.
>
> See http://trove4j.sourceforge.net/ for one implementation, especially
> TIntObjectHashMap in http://trove4j.sourceforge.net/javadocs/. I would be
> delighted to see something like this in commons-collections.

Since the existing commons-primitives component was punted out of
commons-collections, commons-primitives is probably the place for it here.

Depending upon your density, isn't Object[] essentially an int-keyed map?

>
> - Tatu V.
>

- Rod <http://radio.weblogs.com/0122027/>

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message