package NET.worlds.scape; import java.util.Hashtable; public class UniqueHasher { private int currentHash = 0; private static UniqueHasher uh_; private Hashtable ht = new Hashtable(); private UniqueHasher() { } public static UniqueHasher uh() { if (uh_ == null) { uh_ = new UniqueHasher(); } return uh_; } public int hash(Object toHash) { Integer value = (Integer)this.ht.get(toHash); if (value == null) { this.currentHash++; value = new Integer(this.currentHash); this.ht.put(toHash, value); } return value; } }