Class TFloatIntHashMap

    • Field Detail

      • _values

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

      • TFloatIntHashMap

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

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

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

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

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

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

        protected void rehash(int newCapacity)
      • put

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

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

        public int get(float key)
      • clear

        public void clear()
      • isEmpty

        public boolean isEmpty()
      • remove

        public int remove(float key)
      • removeAt

        protected void removeAt(int index)
      • keys

        public float[] keys()
      • keys

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

        public int[] values()
      • values

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

        public boolean containsValue(int val)
      • containsKey

        public boolean containsKey(float key)
      • forEachValue

        public boolean forEachValue(TIntProcedure procedure)
      • transformValues

        public void transformValues(TIntFunction function)
      • increment

        public boolean increment(float key)
      • adjustValue

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

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

        public boolean equals(Object other)
      • hashCode

        public int hashCode()
      • toString

        public String toString()