private abstract static class TextHashFunctions.Fold
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
(package private) java.lang.String |
name |
Modifier | Constructor and Description |
---|---|
private |
Fold() |
Modifier and Type | Method and Description |
---|---|
(package private) abstract int |
fold(int hash,
int bits)
Fold the given 32-bit hash code into only
bits of space. |
abstract int fold(int hash, int bits)
bits
of space.hash
- the 32 bit hash code to be folded into a smaller value.bits
- total number of bits that can appear in the output. The
output value must be in the range [0, 1 << bits)
.
When bits = 2, valid outputs are 0, 1, 2, 3.bits
.