Class IntArrayMappedTrieMath

java.lang.Object
org.javimmutable.collections.common.IntArrayMappedTrieMath

public final class IntArrayMappedTrieMath extends Object
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 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

      @Nonnull public static String hashString(int hashCode)