commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tatu Vanhanen" <>
Subject RE: [primitives] Looking for a primitive hashtable
Date Tue, 30 Mar 2004 07:06:31 GMT
> 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 for one implementation, especially
TIntObjectHashMap in I would be
delighted to see something like this in commons-collections.

- Tatu V.

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

View raw message