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 double |
MAX_LOAD_FACTOR
Maximum sane load factor (10 empty slot per 100).
|
static int |
MIN_HASH_ARRAY_LENGTH
Minimum hash buffer size.
|
static double |
MIN_LOAD_FACTOR
Minimal sane load factor (90 empty slots per 100).
|
| Modifier and Type | Method and Description |
|---|---|
static int |
expandAtCount(int arraySize,
double loadFactor)
Compute the max number of elements
that can be put into a hash container from a power of two arraySize,
given a load factor 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.
|
static int |
minBufferSize(int elements,
double loadFactor)
Gives the minimum size if internal buffers able to accommodate elements,
given loadFactor.
|
static int |
nextBufferSize(int arraySize,
int elements,
double loadFactor)
Gives the next (bigger) size authorized for a buffer
|
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 double MIN_LOAD_FACTOR
public static final double MAX_LOAD_FACTOR
public static int maxElements(double loadFactor)
loadFactor - public static int minBufferSize(int elements,
double loadFactor)
elements - loadFactor - public static int nextBufferSize(int arraySize,
int elements,
double loadFactor)
arraySize - elements - loadFactor - public static int expandAtCount(int arraySize,
double loadFactor)
arraySize - loadFactor - Copyright © 2017. All rights reserved.