Class LongArrayMappedTrieMath

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

public final class LongArrayMappedTrieMath extends Object
Utility class that supports math related to Array Mapped Tries with long 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 long baseIndexFromHashCode(long hashCode)
    • remainderFromHashCode

      public static long remainderFromHashCode(long hashCode)
    • findMaxCommonShift

      public static int findMaxCommonShift(int maxAllowedShift, long hashCode1, long hashCode2)
    • indexFromHashCode

      public static int indexFromHashCode(long hashCode)
    • liftedHashCode

      public static long liftedHashCode(long hashCode, int index)
    • maxShiftsForBitCount

      public static int maxShiftsForBitCount(int bitCount)
    • indexAtShift

      public static int indexAtShift(int shiftCount, long hashCode)
    • baseIndexAtShift

      public static long baseIndexAtShift(int shiftCount, long hashCode)
    • withIndexAtShift

      public static long withIndexAtShift(int shiftCount, long hashCode, int index)
    • hashCodeBelowShift

      public static long hashCodeBelowShift(int shiftCount, long hashCode)
    • findMinimumShiftForZeroBelowHashCode

      public static int findMinimumShiftForZeroBelowHashCode(long hashCode)
    • findMaxShiftForHashCode

      public static int findMaxShiftForHashCode(long hashCode)
    • shift

      public static long shift(int shiftCount, long value)
    • hash

      public static long hash(int... values)
    • hashString

      @Nonnull public static String hashString(long hashCode)