Class TShortDoubleHashMap

    • Field Detail

      • _values

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

      • TShortDoubleHashMap

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

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

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

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

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

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

        protected void rehash(int newCapacity)
      • put

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

        public double putIfAbsent(short key,
                                  double value)
      • putAll

        public void putAll(Map<? extends Short,? extends Double> map)
      • get

        public double get(short key)
      • clear

        public void clear()
      • isEmpty

        public boolean isEmpty()
      • remove

        public double remove(short key)
      • removeAt

        protected void removeAt(int index)
      • keys

        public short[] keys()
      • keys

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

        public double[] values()
      • values

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

        public boolean containsValue(double val)
      • containsKey

        public boolean containsKey(short key)
      • increment

        public boolean increment(short key)
      • adjustValue

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

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

        public boolean equals(Object other)
      • hashCode

        public int hashCode()
      • toString

        public String toString()