void add(String previous, String newWord, int n) { // "now is the" -> <PrefixEntry"time"> Hashtable hm = maps[n]; nEntries[n]++; PrefixEntry e = (PrefixEntry) hm.get(previous); if (e == null) { e = new PrefixEntry(previous); hm.put(previous, e); } e.add(newWord); }