Class TIntShortHashMap

    • Field Detail

      • _values

        protected transient short[] _values
        the values of the map
    • Constructor Detail

      • TIntShortHashMap

        public TIntShortHashMap()
        Creates a new TIntShortHashMap instance with the default capacity and load factor.
      • TIntShortHashMap

        public TIntShortHashMap(int initialCapacity)
        Creates a new TIntShortHashMap instance with a prime capacity equal to or greater than initialCapacity and with the default load factor.
        Parameters:
        initialCapacity - an int value
      • TIntShortHashMap

        public TIntShortHashMap(int initialCapacity,
                                float loadFactor)
        Creates a new TIntShortHashMap instance with a prime capacity equal to or greater than initialCapacity and with the specified load factor.
        Parameters:
        initialCapacity - an int value
        loadFactor - a float value
      • TIntShortHashMap

        public TIntShortHashMap(int initialCapacity,
                                float loadFactor,
                                int noEntryKey,
                                short noEntryValue)
        Creates a new TIntShortHashMap instance with a prime capacity equal to or greater than initialCapacity and with the specified load factor.
        Parameters:
        initialCapacity - an int value
        loadFactor - a float value
        noEntryKey - a int value that represents null for the Key set.
        noEntryValue - a short value that represents null for the Value set.
      • TIntShortHashMap

        public TIntShortHashMap(int[] keys,
                                short[] values)
        Creates a new TIntShortHashMap instance containing all of the entries in the map passed in.
        Parameters:
        keys - a int array containing the keys for the matching values.
        values - a short array containing the values.
      • TIntShortHashMap

        public TIntShortHashMap(TIntShortMap map)
        Creates a new TIntShortHashMap instance containing all of the entries in the map passed in.
        Parameters:
        map - a TIntShortMap that will be duplicated.
    • Method Detail

      • setUp

        protected int setUp(int initialCapacity)
        initializes the hashtable to a prime capacity which is at least initialCapacity + 1.
        Overrides:
        setUp in class  TIntShortHash
        Parameters:
        initialCapacity - an int value
        Returns:
        the actual capacity chosen
      • rehash

        protected void rehash(int newCapacity)
      • put

        public short put(int key,
                         short value)
      • putIfAbsent

        public short putIfAbsent(int key,
                                 short value)
      • get

        public short get(int key)
      • clear

        public void clear()
      • isEmpty

        public boolean isEmpty()
      • remove

        public short remove(int key)
      • removeAt

        protected void removeAt(int index)
      • keys

        public int[] keys()
      • keys

        public int[] keys(int[] array)
      • values

        public short[] values()
      • values

        public short[] values(short[] array)
      • containsValue

        public boolean containsValue(short val)
      • containsKey

        public boolean containsKey(int key)
      • forEachKey

        public boolean forEachKey(TIntProcedure procedure)
      • transformValues

        public void transformValues(TShortFunction function)
      • increment

        public boolean increment(int key)
      • adjustValue

        public boolean adjustValue(int key,
                                   short amount)
      • adjustOrPutValue

        public short adjustOrPutValue(int key,
                                      short adjust_amount,
                                      short put_amount)
      • equals

        public boolean equals(Object other)
      • hashCode

        public int hashCode()
      • toString

        public String toString()