Class TCharFloatHashMap

    • Field Detail

      • _values

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

      • TCharFloatHashMap

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

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

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

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

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

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

        protected void rehash(int newCapacity)
      • put

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

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

        public float get(char key)
      • clear

        public void clear()
      • isEmpty

        public boolean isEmpty()
      • remove

        public float remove(char key)
      • removeAt

        protected void removeAt(int index)
      • keys

        public char[] keys()
      • keys

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

        public float[] values()
      • values

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

        public boolean containsValue(float val)
      • containsKey

        public boolean containsKey(char key)
      • transformValues

        public void transformValues(TFloatFunction function)
      • increment

        public boolean increment(char key)
      • adjustValue

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

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

        public boolean equals(Object other)
      • hashCode

        public int hashCode()
      • toString

        public String toString()