Package org.eclipse.jgit.pgm.debug
Class TextHashFunctions.Fold
java.lang.Object
org.eclipse.jgit.pgm.debug.TextHashFunctions.Fold
- Enclosing class:
- TextHashFunctions
Base class for any hashCode folding function to be tested.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) abstract int
fold
(int hash, int bits) Fold the given 32-bit hash code into onlybits
of space.
-
Field Details
-
name
String name
-
-
Constructor Details
-
Fold
private Fold()
-
-
Method Details
-
fold
abstract int fold(int hash, int bits) Fold the given 32-bit hash code into onlybits
of space.- Parameters:
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.- Returns:
- the folded hash, squeezed into only
bits
.
-