Alex Karasulu wrote:

Hello,

I've been looking to see if we have a primitive hash table keyed by the int primitive type laying around somewhere. I could not find anything in the primitives project but could have sworn I saw one here at Apache somewhere. Any idea where I could find one?

I'm probably outta luck if one does not exist in the primitives packages.

Alex



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



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




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



Reply via email to