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
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final int -
Method Summary
Modifier and TypeMethodDescriptionstatic intbaseIndexAtShift(int shiftCount, int hashCode) static intbaseIndexFromHashCode(int hashCode) static intfindMaxCommonShift(int maxAllowedShift, int hashCode1, int hashCode2) static intfindMinimumShiftForZeroBelowHashCode(int hashCode) static inthash(int shift5, int shift4, int shift3, int shift2, int shift1, int shift0) static inthashCodeBelowShift(int shiftCount, int hashCode) static StringhashString(int hashCode) static intindexAtShift(int shiftCount, int hashCode) static intindexFromHashCode(int hashCode) static intliftedHashCode(int hashCode, int index) static intmaxShiftsForBitCount(int bitCount) static intremainderFromHashCode(int hashCode) static intshift(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
-