Class TCharIntHashMap

    • Field Detail

      • _values

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

      • TCharIntHashMap

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

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

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

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

        public TCharIntHashMap(char[] keys,
                               int[] values)
        Creates a new TCharIntHashMap 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 int array containing the values.
      • TCharIntHashMap

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

        protected void rehash(int newCapacity)
      • put

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

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

        public int get(char key)
      • clear

        public void clear()
      • isEmpty

        public boolean isEmpty()
      • remove

        public int remove(char key)
      • removeAt

        protected void removeAt(int index)
      • keys

        public char[] keys()
      • keys

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

        public int[] values()
      • values

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

        public boolean containsValue(int val)
      • containsKey

        public boolean containsKey(char key)
      • forEachValue

        public boolean forEachValue(TIntProcedure procedure)
      • transformValues

        public void transformValues(TIntFunction function)
      • increment

        public boolean increment(char key)
      • adjustValue

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

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

        public boolean equals(Object other)
      • hashCode

        public int hashCode()
      • toString

        public String toString()