Class TObjectFloatHashMap<K>

    • Field Detail

      • _values

        protected transient float[] _values
        the values of the map
      • no_entry_value

        protected float no_entry_value
        the value that represents null
    • Constructor Detail

      • TObjectFloatHashMap

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

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

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

        public TObjectFloatHashMap(int initialCapacity,
                                   float loadFactor,
                                   float noEntryValue)
        Creates a new TObjectFloatHashMap instance with a prime value at or near the specified capacity and load factor.
        Parameters:
        initialCapacity - used to find a prime capacity for the table.
        loadFactor - used to calculate the threshold over which rehashing takes place.
        noEntryValue - the value used to represent null.
      • TObjectFloatHashMap

        public TObjectFloatHashMap(TObjectFloatMap<? extends K> map)
        Creates a new TObjectFloatHashMap that contains the entries in the map passed to it.
        Parameters:
        map - the TObjectFloatMap to be copied.
    • Method Detail

      • setUp

        public int setUp(int initialCapacity)
        initializes the hashtable to a prime capacity which is at least initialCapacity + 1.
        Overrides:
        setUp in class  TObjectHash<K>
        Parameters:
        initialCapacity - an int value
        Returns:
        the actual capacity chosen
      • rehash

        protected void rehash(int newCapacity)
        rehashes the map to the new capacity.
        Specified by:
        rehash in class  THash
        Parameters:
        newCapacity - an int value
      • getNoEntryValue

        public float getNoEntryValue()
      • containsKey

        public boolean containsKey(Object key)
      • containsValue

        public boolean containsValue(float val)
      • get

        public float get(Object key)
      • put

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

        public float putIfAbsent(K key,
                                 float value)
      • remove

        public float remove(Object key)
      • removeAt

        protected void removeAt(int index)
        Removes the mapping at index from the map. This method is used internally and public mainly because of packaging reasons. Caveat Programmer.
        Overrides:
        removeAt in class  TObjectHash<K>
        Parameters:
        index - an int value
      • putAll

        public void putAll(Map<? extends K,? extends Float> map)
      • clear

        public void clear()
      • keySet

        public Set<K> keySet()
      • keys

        public Object[] keys()
      • keys

        public K[] keys(K[] a)
      • values

        public float[] values()
      • values

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

        public boolean increment(K key)
      • adjustValue

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

        public float adjustOrPutValue(K key,
                                      float adjust_amount,
                                      float put_amount)
      • forEachKey

        public boolean forEachKey(TObjectProcedure<? super K> procedure)
        Executes procedure for each key in the map.
        Specified by:
        forEachKey in interface  TObjectFloatMap<K>
        Parameters:
        procedure - a TObjectProcedure value
        Returns:
        false if the loop over the keys terminated because the procedure returned false for some key.
      • forEachValue

        public boolean forEachValue(TFloatProcedure procedure)
        Executes procedure for each value in the map.
        Specified by:
        forEachValue in interface  TObjectFloatMap<K>
        Parameters:
        procedure - a TFloatProcedure value
        Returns:
        false if the loop over the values terminated because the procedure returned false for some value.
      • forEachEntry

        public boolean forEachEntry(TObjectFloatProcedure<? super K> procedure)
        Executes procedure for each key/value entry in the map.
        Specified by:
        forEachEntry in interface  TObjectFloatMap<K>
        Parameters:
        procedure - a TOObjectFloatProcedure value
        Returns:
        false if the loop over the entries terminated because the procedure returned false for some entry.
      • retainEntries

        public boolean retainEntries(TObjectFloatProcedure<? super K> procedure)
        Retains only those entries in the map for which the procedure returns a true value.
        Specified by:
        retainEntries in interface  TObjectFloatMap<K>
        Parameters:
        procedure - determines which entries to keep
        Returns:
        true if the map was modified.
      • transformValues

        public void transformValues(TFloatFunction function)
        Transform the values in this map using function.
        Specified by:
        transformValues in interface  TObjectFloatMap<K>
        Parameters:
        function - a TFloatFunction value
      • equals

        public boolean equals(Object other)
        Compares this map with another map for equality of their stored entries.
        Specified by:
        equals in interface  TObjectFloatMap<K>
        Overrides:
        equals in class  Object
        Parameters:
        other - an Object value
        Returns:
        a boolean value
      • hashCode

        public int hashCode()
      • toString

        public String toString()