Class IntArrayMappedTrieMath
java.lang.Object
org.javimmutable.collections.common.IntArrayMappedTrieMath
Utility class that supports math related to Array Mapped Tries with
integer hash codes and 64 element arrays. All of the methods are static
and short so they should wind up being inlined by compiler or jit.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
static final int
static final int
static final int
-
Method Summary
Modifier and TypeMethodDescriptionstatic int
baseIndexAtShift
(int shiftCount, int hashCode) static int
baseIndexFromHashCode
(int hashCode) static int
findMaxCommonShift
(int maxAllowedShift, int hashCode1, int hashCode2) static int
findMinimumShiftForZeroBelowHashCode
(int hashCode) static int
hash
(int shift5, int shift4, int shift3, int shift2, int shift1, int shift0) static int
hashCodeBelowShift
(int shiftCount, int hashCode) static String
hashString
(int hashCode) static int
indexAtShift
(int shiftCount, int hashCode) static int
indexFromHashCode
(int hashCode) static int
liftedHashCode
(int hashCode, int index) static int
maxShiftsForBitCount
(int bitCount) static int
remainderFromHashCode
(int hashCode) static int
shift
(int shiftCount, int value)
-
Field Details
-
MAX_SHIFTS
public static final int MAX_SHIFTS -
MAX_FULL_SHIFTS
public static final int MAX_FULL_SHIFTS -
MAX_SHIFT_NUMBER
public static final int MAX_SHIFT_NUMBER -
MAX_FULL_SHIFT_NUMBER
public static final int MAX_FULL_SHIFT_NUMBER
-
-
Method Details
-
baseIndexFromHashCode
public static int baseIndexFromHashCode(int hashCode) -
remainderFromHashCode
public static int remainderFromHashCode(int hashCode) -
findMaxCommonShift
public static int findMaxCommonShift(int maxAllowedShift, int hashCode1, int hashCode2) -
indexFromHashCode
public static int indexFromHashCode(int hashCode) -
liftedHashCode
public static int liftedHashCode(int hashCode, int index) -
maxShiftsForBitCount
public static int maxShiftsForBitCount(int bitCount) -
indexAtShift
public static int indexAtShift(int shiftCount, int hashCode) -
baseIndexAtShift
public static int baseIndexAtShift(int shiftCount, int hashCode) -
hashCodeBelowShift
public static int hashCodeBelowShift(int shiftCount, int hashCode) -
findMinimumShiftForZeroBelowHashCode
public static int findMinimumShiftForZeroBelowHashCode(int hashCode) -
shift
public static int shift(int shiftCount, int value) -
hash
public static int hash(int shift5, int shift4, int shift3, int shift2, int shift1, int shift0) -
hashString
-