Class TShortCharHashMap

    • Field Detail

      • _values

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

      • TShortCharHashMap

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

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

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

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

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

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

        protected void rehash(int newCapacity)
      • put

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

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

        public char get(short key)
      • clear

        public void clear()
      • isEmpty

        public boolean isEmpty()
      • remove

        public char remove(short key)
      • removeAt

        protected void removeAt(int index)
      • keys

        public short[] keys()
      • keys

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

        public char[] values()
      • values

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

        public boolean containsValue(char val)
      • containsKey

        public boolean containsKey(short key)
      • forEachValue

        public boolean forEachValue(TCharProcedure procedure)
      • transformValues

        public void transformValues(TCharFunction function)
      • increment

        public boolean increment(short key)
      • adjustValue

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

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

        public boolean equals(Object other)
      • hashCode

        public int hashCode()
      • toString

        public String toString()