Hi Mike,

I have a query, why is this implementation limitted to String?
Is this by intent?

in HashMap the patch for hash calculation is 
 290     final int hash(Object k) {
 291         int h = hashMask;
 292         if ((0 != h) && (k instanceof String)) {
 293             return h ^ ((String)k).hash32();
....
whereas I would have thought that it should be 
 290     final int hash(Object k) {
 291         int h = hashMask;
 292         if ((0 != h) && (k instanceof Hash32)) {
 293             return h ^ ((Hash32)k).hash32();
....

As a more flexible improvement could you supply a HashCode and Equals delegate, 
and then the user can supply either a custom delegate, suitable for that 
application (e.g.one that iterates through array content, or any other 
application data structure that needs to be handled differently like c# uses 
http://msdn.microsoft.com/en-us/library/system.collections.iequalitycomparer )

Regards

Mike

Reply via email to