All Packages Class Hierarchy This Package Previous Next Index
Interface collections.HashTableParams
- public interface interface HashTableParams
Base interface for hash table based collections.
Provides common ways of dealing with buckets and threshholds.
(It would be nice to share some of the code too, but this
would require multiple inheritance here.)
-
defaultInitialBuckets
- The default initial number of buckets of a non-empty HT
-
defaultLoadFactor
- The default load factor for a non-empty HT.
-
buckets()
- return the current number of hash table buckets
-
buckets(int)
- Set the desired number of buckets in the hash table.
-
thresholdLoadFactor()
- Return the current load factor threshold
The Hash table occasionally checka against the load factor
resizes itself if it has gone past it.
-
thresholdLoadFactor(float)
- Set the current desired load factor.
defaultInitialBuckets
public static final int defaultInitialBuckets
- The default initial number of buckets of a non-empty HT
defaultLoadFactor
public static final float defaultLoadFactor
- The default load factor for a non-empty HT. When the proportion
of elements per buckets exceeds this, the table is resized.
buckets
public abstract int buckets()
- return the current number of hash table buckets
buckets
public abstract void buckets(int newCap) throws IllegalArgumentException
- Set the desired number of buckets in the hash table.
Any value greater than or equal to one is OK.
if different than current buckets, causes a version change
- Throws: IllegalArgumentException
- if newCap less than 1
thresholdLoadFactor
public abstract float thresholdLoadFactor()
- Return the current load factor threshold
The Hash table occasionally checka against the load factor
resizes itself if it has gone past it.
thresholdLoadFactor
public abstract void thresholdLoadFactor(float desired) throws IllegalArgumentException
- Set the current desired load factor. Any value greater than 0 is OK.
The current load is checked against it, possibly causing resize.
- Throws: IllegalArgumentException
- if desired is 0 or less
All Packages Class Hierarchy This Package Previous Next Index