Top Fields Constructors Methods
com.carrotsearch.hppc

public final Class HashContainers

extends Object
Class Inheritance
Imports
java.util.concurrent.atomic.AtomicInteger

Field Summary

Modifier and TypeField and Description
public static final float
DEFAULT_LOAD_FACTOR

Default load factor.

private static final AtomicInteger
public static final int
MAX_HASH_ARRAY_LENGTH

Maximum array size for hash containers (power-of-two and still allocable in Java, not a negative int).

public static final float
MAX_LOAD_FACTOR

Maximum sane load factor (1 empty slot per 100).

public static final int
MIN_HASH_ARRAY_LENGTH

Minimum hash buffer size.

public static final float
MIN_LOAD_FACTOR

Minimal sane load factor (99 empty slots per 100).

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
pack-priv static void
checkLoadFactor(double loadFactor, double minAllowedInclusive, double maxAllowedInclusive)

pack-priv static boolean
checkPowerOfTwo(int arraySize)

pack-priv static int
expandAtCount(int arraySize, double loadFactor)

pack-priv static int
iterationIncrement(int seed)

Computes a hash iteration order increment based on the provided seed.

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

pack-priv static int
minBufferSize(int elements, double loadFactor)

pack-priv static int
nextBufferSize(int arraySize, int elements, double loadFactor)

pack-priv static int
nextIterationSeed()

Provides the next hash iteration order seed.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

DEFAULT_LOAD_FACTORback to summary
public static final float DEFAULT_LOAD_FACTOR

Default load factor.

ITERATION_SEEDback to summary
private static final AtomicInteger ITERATION_SEED
MAX_HASH_ARRAY_LENGTHback to summary
public static final int MAX_HASH_ARRAY_LENGTH

Maximum array size for hash containers (power-of-two and still allocable in Java, not a negative int).

MAX_LOAD_FACTORback to summary
public static final float MAX_LOAD_FACTOR

Maximum sane load factor (1 empty slot per 100).

MIN_HASH_ARRAY_LENGTHback to summary
public static final int MIN_HASH_ARRAY_LENGTH

Minimum hash buffer size.

MIN_LOAD_FACTORback to summary
public static final float MIN_LOAD_FACTOR

Minimal sane load factor (99 empty slots per 100).

Constructor Detail

HashContainersback to summary
public HashContainers()

Method Detail

checkLoadFactorback to summary
pack-priv static void checkLoadFactor(double loadFactor, double minAllowedInclusive, double maxAllowedInclusive)
checkPowerOfTwoback to summary
pack-priv static boolean checkPowerOfTwo(int arraySize)
expandAtCountback to summary
pack-priv static int expandAtCount(int arraySize, double loadFactor)
iterationIncrementback to summary
pack-priv static int iterationIncrement(int seed)

Computes a hash iteration order increment based on the provided seed.

maxElementsback to summary
public 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.

minBufferSizeback to summary
pack-priv static int minBufferSize(int elements, double loadFactor)
nextBufferSizeback to summary
pack-priv static int nextBufferSize(int arraySize, int elements, double loadFactor)
nextIterationSeedback to summary
pack-priv static int nextIterationSeed()

Provides the next hash iteration order seed. It is simply an incrementing atomic counter.