Class IntMap


  • public class IntMap
    extends Object
    The IntMap provides a simple hashmap from keys to integers. The API is an abbreviation of the HashMap collection API.

    The convenience of IntMap is avoiding all the silly wrapping of integers.

    • Field Detail

      • NULL

        public static final int NULL
        Encoding of a null entry. Since NULL is equal to Integer.MIN_VALUE, it's impossible to distinguish between the two.
        See Also:
        Constant Field Values
      • PRIMES

        public static final int[] PRIMES
    • Constructor Detail

      • IntMap

        public IntMap()
        Create a new IntMap. Default size is 16.
    • Method Detail

      • clear

        public void clear()
        Clear the hashmap.
      • size

        public final int size()
        Returns the current number of entries in the map.
      • get

        public final int get​(Object key)
        Puts a new value in the property table with the appropriate flags
      • put

        public final int put​(Object key,
                             int value,
                             boolean isReplace)
        Puts a new value in the property table with the appropriate flags
      • hashCode

        protected int hashCode​(Object value)
      • getBiggestPrime

        public static int getBiggestPrime​(int value)