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

- Tatu V.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to