/* * Created on Jul 27, 2004 */ package hashing; /** An object which can hash other objects. *
* Concrete classes should have a constructor which takes a single argument * as follows: *
* module - an integer -1. Set the modulus to be used for the final stage of computing the hash * value. All hash values produced will be in the range 0..modulus-1. * @author dickey */ public interface IHasher { /** Produce a hash value for the given object. * * @param obj any non-null object. * @return a value in the range 0..modulus-1, where modulus is the modulus * supplied when the hasher was created. */ int hash(Object obj); /** Report what modulus this hash function is using. * * @return the modulus used by this hasher to limit the range of hash * values produced. */ int getModulus(); }