HashBase
The base for other hash classes.
| Methods |
| void |
checkSizePut()
Check the size before adding an entry.
|
| void |
checkSizePut()
Check the size before adding an entry. This method resizes the map if
required.
|
| void |
checkSizeRemove()
Check the size before removing an entry.
|
| void |
checkSizeRemove()
Check the size before removing an entry. This method resizes the map if
required.
|
| int |
getIndex(int hash)
Calculate the index for this hash code.
|
| int |
getIndex(int hash)
Calculate the index for this hash code.
Parameters:
hash - the hash code
Returns:
the index
|
| void |
rehash(int newLevel)
Increase the size of the underlying table and re-distribute the elements.
|
| void |
rehash(int newLevel)
Increase the size of the underlying table and re-distribute the elements.
Parameters:
newLevel - the new level
|
| void |
reset(int newLevel)
Clear the map and reset the level to the specified value.
|
| void |
reset(int newLevel)
Clear the map and reset the level to the specified value.
Parameters:
newLevel - the new level
|
| int |
size()
Get the size of the map.
|
| int |
size()
Get the size of the map.
Returns:
the size
|
deletedCount
The number of deleted slots.
len
The number of slots in the table.
level
The level. The number of slots is 2 ^ level.
mask
The bit mask to get the index from the hash code.
size
The number of occupied slots, excluding the zero key (if any).
zeroKey
Whether the zero key is used.