public class Hashing extends Object
| Modifier and Type | Field and Description |
|---|---|
static float |
DEFAULT_LOAD_FACTOR
Default load factor to be used in open addressing hashed data structures.
|
| Constructor and Description |
|---|
Hashing() |
| Modifier and Type | Method and Description |
|---|---|
static long |
compoundKey(int keyPartA,
int keyPartB)
Combined two 32 bit keys into a 64-bit compound.
|
static int |
evenHash(int value,
int mask)
Generate an even hash for a int value.
|
static int |
evenHash(long value,
int mask)
Generate an even hash for a long value.
|
static int |
hash(int value)
Generate a hash for an int value.
|
static int |
hash(int value,
int mask)
Generate a hash for a int value.
|
static <K> int |
hash(K value,
int mask)
Generate a hash for a K value.
|
static int |
hash(long value)
Generate a hash for an long value.
|
static int |
hash(long value,
int mask)
Generate a hash for a long value.
|
public static final float DEFAULT_LOAD_FACTOR
public static int hash(int value)
value - to be hashed.public static int hash(long value)
value - to be hashed.public static int hash(int value,
int mask)
value - to be hashed.mask - mask to be applied that must be a power of 2 - 1.public static <K> int hash(K value,
int mask)
K - is the type of valuevalue - to be hashed.mask - mask to be applied that must be a power of 2 - 1.public static int hash(long value,
int mask)
value - to be hashed.mask - mask to be applied that must be a power of 2 - 1.public static int evenHash(int value,
int mask)
value - to be hashed.mask - mask to be applied that must be a power of 2 - 1.public static int evenHash(long value,
int mask)
value - to be hashed.mask - mask to be applied that must be a power of 2 - 1.public static long compoundKey(int keyPartA,
int keyPartB)
keyPartA - to make the upper bitskeyPartB - to make the lower bits.