gnu.trove
public abstract class TPrimitiveHash extends THash
Version: $Id: TPrimitiveHash.java,v 1.3 2002/09/20 20:55:58 ericdf Exp $
| Field Summary | |
|---|---|
| protected static byte | FREE flag indicating that a slot in the hashtable is available |
| protected static byte | FULL flag indicating that a slot in the hashtable is occupied |
| protected static byte | REMOVED flag indicating that the value of a slot in the hashtable
was deleted |
| protected byte[] | _states flags indicating whether each position in the hash is
FREE, FULL, or REMOVED |
| Constructor Summary | |
|---|---|
| TPrimitiveHash()
Creates a new THash instance with the default
capacity and load factor. | |
| TPrimitiveHash(int initialCapacity)
Creates a new TPrimitiveHash instance with a prime
capacity at or near the specified capacity and with the default
load factor.
| |
| TPrimitiveHash(int initialCapacity, float loadFactor)
Creates a new TPrimitiveHash instance with a prime
capacity at or near the minimum needed to hold
initialCapacity elements with load factor
loadFactor without triggering a rehash.
| |
| Method Summary | |
|---|---|
| protected int | capacity()
Returns the capacity of the hash table. |
| Object | clone() |
| protected void | removeAt(int index)
Delete the record at index.
|
| protected int | setUp(int initialCapacity)
initializes the hashtable to a prime capacity which is at least
initialCapacity + 1.
|
THash instance with the default
capacity and load factor.TPrimitiveHash instance with a prime
capacity at or near the specified capacity and with the default
load factor.
Parameters: initialCapacity an int value
TPrimitiveHash instance with a prime
capacity at or near the minimum needed to hold
initialCapacity elements with load factor
loadFactor without triggering a rehash.
Parameters: initialCapacity an int value loadFactor a float value
Returns: the physical capacity of the hash table.
Parameters: index an int value
Parameters: initialCapacity an int value
Returns: the actual capacity chosen