Class TIntFloatHashMap

    • Field Detail

      • _values

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

      • TIntFloatHashMap

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

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

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

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

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

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

        protected void rehash(int newCapacity)
      • put

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

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

        public float get(int key)
      • clear

        public void clear()
      • isEmpty

        public boolean isEmpty()
      • remove

        public float remove(int key)
      • removeAt

        protected void removeAt(int index)
      • keys

        public int[] keys()
      • keys

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

        public float[] values()
      • values

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

        public boolean containsValue(float val)
      • containsKey

        public boolean containsKey(int key)
      • forEachKey

        public boolean forEachKey(TIntProcedure procedure)
      • transformValues

        public void transformValues(TFloatFunction function)
      • increment

        public boolean increment(int key)
      • adjustValue

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

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

        public boolean equals(Object other)
      • hashCode

        public int hashCode()
      • toString

        public String toString()