Java Utililty Methods Hashtable Create

List of utility methods to do Hashtable Create

Description

The list of methods to do Hashtable Create are organized into topic(s).

Method

HashtablecreateHashtable(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;
EnumerationgetGUIDS(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);
ObjectgetKeyByEntry(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;
...
HashtablenewHashtable(int initialCapacity)
new Hashtable
return new Hashtable<K, V>(initialCapacity);
HashtablenewHashTable(int initialCapacity, float loadFactor)
new Hash Table
return new Hashtable<>(initialCapacity, loadFactor);