public final class HashContainers
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static float |
DEFAULT_LOAD_FACTOR
Default load factor.
|
static int |
MAX_HASH_ARRAY_LENGTH
Maximum array size for hash containers (power-of-two and still
allocable in Java, not a negative int).
|
static float |
MAX_LOAD_FACTOR
Maximum sane load factor (1 empty slot per 100).
|
static int |
MIN_HASH_ARRAY_LENGTH
Minimum hash buffer size.
|
static float |
MIN_LOAD_FACTOR
Minimal sane load factor (99 empty slots per 100).
|
| Constructor and Description |
|---|
HashContainers() |
| Modifier and Type | Method and Description |
|---|---|
(package private) static void |
checkLoadFactor(double loadFactor,
double minAllowedInclusive,
double maxAllowedInclusive) |
(package private) static boolean |
checkPowerOfTwo(int arraySize) |
(package private) static int |
expandAtCount(int arraySize,
double loadFactor) |
static int |
maxElements(double loadFactor)
Compute and return the maximum number of elements (inclusive)
that can be stored in a hash container for a given load factor.
|
(package private) static int |
minBufferSize(int elements,
double loadFactor) |
(package private) static int |
nextBufferSize(int arraySize,
int elements,
double loadFactor) |
public static final int MAX_HASH_ARRAY_LENGTH
public static final int MIN_HASH_ARRAY_LENGTH
public static final float DEFAULT_LOAD_FACTOR
public static final float MIN_LOAD_FACTOR
public static final float MAX_LOAD_FACTOR
public static int maxElements(double loadFactor)
static int minBufferSize(int elements,
double loadFactor)
static int nextBufferSize(int arraySize,
int elements,
double loadFactor)
static int expandAtCount(int arraySize,
double loadFactor)
static void checkLoadFactor(double loadFactor,
double minAllowedInclusive,
double maxAllowedInclusive)
static boolean checkPowerOfTwo(int arraySize)