Class TIntDoubleHashMap

    • Field Detail

      • _values

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

      • TIntDoubleHashMap

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

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

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

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

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

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

        protected void rehash(int newCapacity)
      • put

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

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

        public double get(int key)
      • clear

        public void clear()
      • isEmpty

        public boolean isEmpty()
      • remove

        public double remove(int key)
      • removeAt

        protected void removeAt(int index)
      • keys

        public int[] keys()
      • keys

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

        public double[] values()
      • values

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

        public boolean containsValue(double val)
      • containsKey

        public boolean containsKey(int key)
      • forEachKey

        public boolean forEachKey(TIntProcedure procedure)
      • increment

        public boolean increment(int key)
      • adjustValue

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

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

        public boolean equals(Object other)
      • hashCode

        public int hashCode()
      • toString

        public String toString()