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.)


Variable Index

 o defaultInitialBuckets
The default initial number of buckets of a non-empty HT
 o defaultLoadFactor
The default load factor for a non-empty HT.

Method Index

 o buckets()
return the current number of hash table buckets
 o buckets(int)
Set the desired number of buckets in the hash table.
 o thresholdLoadFactor()
Return the current load factor threshold The Hash table occasionally checka against the load factor resizes itself if it has gone past it.
 o thresholdLoadFactor(float)
Set the current desired load factor.

Variables

 o defaultInitialBuckets
 public static final int defaultInitialBuckets
The default initial number of buckets of a non-empty HT

 o 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.

Methods

 o buckets
 public abstract int buckets()
return the current number of hash table buckets

 o 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
 o 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.

 o 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