List of utility methods to do Hashtable Create
Hashtable | createHashtable(int size) create Hashtable return new Hashtable((int) Math.ceil((double) size / 0.75)); |
Object[] | getArray(Hashtable hash) This method was created in VisualAge. int len = hash.size(); Object[] objs = new Object[len]; Enumeration e = hash.elements(); for (int i = 1; e.hasMoreElements(); i++) objs[len - i] = e.nextElement(); return objs; |
Enumeration | getGUIDS(Hashtable table) get GUIDS TreeSet<String> set = new TreeSet<>(); Enumeration eenum = table.keys(); while (eenum.hasMoreElements()) { String str = (String) eenum.nextElement(); set.add(str.substring(0, str.indexOf(";"))); return Collections.enumeration(set); |
Object | getKeyByEntry(Hashtable t, Object value) returns a value. Object key; for (Enumeration e = t.keys(); e.hasMoreElements();) { key = e.nextElement(); if (value.equals(t.get(key))) { return key; return null; ... |
Hashtable | newHashtable(int initialCapacity) new Hashtable return new Hashtable<K, V>(initialCapacity); |
Hashtable | newHashTable(int initialCapacity, float loadFactor) new Hash Table return new Hashtable<>(initialCapacity, loadFactor); |