public class Idmap extends CHMap { public Idmap(int cap) // constructor { super(cap); // calls superclass constructor //abstract class constructor can only be called here } protected Idmap makemap(int cap) //abstract method { return new Idmap(cap); } protected String[] makeKarray(int n) { return new String[n]; } protected Integer[] makeVarray(int n) { return new Integer[n]; } protected int hash0(String key)// test hash function { int ax = 0; // add up all ascii values for(int i=0;i0) s += (char)(int)(Math.random()*26 + 97); return s; } public static void main(String[] av) { Idmap M = new Idmap(8); M.set("John",702111111); M.set("Jane",702333333); M.set("Mary",702123456); M.set("Larz",702654321); M.set("Narx",702111222); // test get System.out.println("Mary's id is "+M.get("Mary")); M.remove("Larz"); System.out.println("Narx's id is "+M.get("Narx")); System.out.println("Larz's id is "+M.get("Larz")); System.out.println("Fred's id is "+M.get("Fred")); System.out.println("size of map is "+M.size()); System.out.println("capapcity of map is "+M.capacity()); System.out.println("keycount of map is "+M.keycount); M.printtable(); String[] keys = M.allKeys(); for(String k:keys) System.out.print(k+" "); // M.increasecap(); for(int i=0;i<30;i++) M.set(randstr(6),702000000+(int)(Math.random()*1000000)); M.printtable(); System.out.println("new capapcity of map is "+M.capacity()); System.out.println("size of map is "+M.size()); System.out.println("keycount of map is "+M.keycount); }//main }//Idmap