public abstract class HashBase extends Object
Modifier and Type | Field and Description |
---|---|
protected int |
deletedCount
The number of deleted slots.
|
protected int |
len
The number of slots in the table.
|
protected int |
level
The level.
|
protected int |
mask
The bit mask to get the index from the hash code.
|
protected int |
size
The number of occupied slots, excluding the zero key (if any).
|
protected boolean |
zeroKey
Whether the zero key is used.
|
Constructor and Description |
---|
HashBase() |
Modifier and Type | Method and Description |
---|---|
protected void |
checkSizeRemove()
Check the size before removing an entry.
|
protected int |
getIndex(int hash)
Calculate the index for this hash code.
|
protected abstract void |
rehash(int newLevel)
Increase the size of the underlying table and re-distribute the elements.
|
protected void |
reset(int newLevel)
Clear the map and reset the level to the specified value.
|
int |
size()
Get the size of the map.
|
protected int mask
protected int len
protected int size
protected int deletedCount
protected int level
protected boolean zeroKey
protected abstract void rehash(int newLevel)
newLevel
- the new levelpublic int size()
protected void checkSizeRemove()
protected void reset(int newLevel)
newLevel
- the new levelprotected int getIndex(int hash)
hash
- the hash codeCopyright © 2012 JBoss by Red Hat. All Rights Reserved.