March 2004
Intermediate to advanced
560 pages
26h 47m
English
public interface IHashCodeProvider { // Methods int GetHashCode (object obj); }
|
BG Note that the IHashCodeProvider interface allows you to define your own hash function for a given object. This allows users to either override it for special comparisons such as case-insensitive string lookup, or to replace a poorly written hash function on a third party data type. Combined with IComparer, you can use types as keys in a Hashtable even if the original author neglected to override Equals and GetHashCode on their type. One note on IHashCodeProvider—many of our users either don't get the type or don't understand when they need to do it. We've found instances where people want to use a case-insensitive Hashtable, yet they remember to ... |
Read now
Unlock full access