Class TCharShortHashMap

    • Field Detail

      • _values

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

      • TCharShortHashMap

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

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

        public TCharShortHashMap(int initialCapacity,
                                 float loadFactor)
        Creates a new TCharShortHashMap 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
      • TCharShortHashMap

        public TCharShortHashMap(int initialCapacity,
                                 float loadFactor,
                                 char noEntryKey,
                                 short noEntryValue)
        Creates a new TCharShortHashMap 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 char value that represents null for the Key set.
        noEntryValue - a short value that represents null for the Value set.
      • TCharShortHashMap

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

        public TCharShortHashMap(TCharShortMap map)
        Creates a new TCharShortHashMap instance containing all of the entries in the map passed in.
        Parameters:
        map - a TCharShortMap 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  TCharShortHash
        Parameters:
        initialCapacity - an int value
        Returns:
        the actual capacity chosen
      • rehash

        protected void rehash(int newCapacity)
      • put

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

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

        public short get(char key)
      • clear

        public void clear()
      • isEmpty

        public boolean isEmpty()
      • remove

        public short remove(char key)
      • removeAt

        protected void removeAt(int index)
      • keys

        public char[] keys()
      • keys

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

        public short[] values()
      • values

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

        public boolean containsValue(short val)
      • containsKey

        public boolean containsKey(char key)
      • transformValues

        public void transformValues(TShortFunction function)
      • increment

        public boolean increment(char key)
      • adjustValue

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

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

        public boolean equals(Object other)
      • hashCode

        public int hashCode()
      • toString

        public String toString()