Creates new entry to be immediately inserted into the hashtable.
Creates new entry to be immediately inserted into the hashtable. This method is guaranteed to be called only once and in case that the entry will be added. In other words, an implementation may be side-effecting.
Add entry to table pre: no entry with same key exists
Add entry to table pre: no entry with same key exists
Remove all entries from table
Remove all entries from table
An iterator returning all entries.
An iterator returning all entries.
Find entry with given key in table, null if not found.
Find entry with given key in table, null if not found.
Find entry with given key in table, or add new one if not found.
Find entry with given key in table, or add new one if not found.
May be somewhat faster then findEntry
/addEntry
pair as it
computes entry's hash index only once.
Returns entry found in table or null.
New entries are created by calling createNewEntry
method.
Avoid iterator for a 2x faster traversal.
Avoid iterator for a 2x faster traversal.
Returns string formatted according to given format
string.
Returns string formatted according to given format
string.
Format strings are as for String.format
(@see java.lang.String.format).
The initial size of the hash table.
The initial size of the hash table.
Remove entry from table if present.
Remove entry from table if present.
The array keeping track of the number of elements in 32 element blocks.
The array keeping track of the number of elements in 32 element blocks.
The actual hash table.
The actual hash table.
The number of mappings contained in this hash table.
The number of mappings contained in this hash table.
The next size value at which to resize (capacity * load factor).
The next size value at which to resize (capacity * load factor).
This class can be used to construct data structures that are based on hashtables. Class
HashTable[A]
implements a hashtable that maps keys of typeA
to values of the fully abstract member typeEntry
. Classes that make use ofHashTable
have to provide an implementation forEntry
.There are mainly two parameters that affect the performance of a hashtable: the initial size and the load factor. The size refers to the number of buckets in the hashtable, and the load factor is a measure of how full the hashtable is allowed to get before its size is automatically doubled. Both parameters may be changed by overriding the corresponding values in class
HashTable
.type of the elements contained in this hash table.
2.0, 31/12/2006
1