Documentation of 'jsat.utils.IntDoubleMap' Java class
IntDoubleMap
jsat.utils

Class IntDoubleMap

  • All Implemented Interfaces:
    java.util.Map<java.lang.Integer,java.lang.Double>


    public final class IntDoubleMap
    extends java.util.AbstractMap<java.lang.Integer,java.lang.Double>
    A hash map for storing the primitive types of integers (as keys) to doubles (as table). The implementation is based on Algorithm D (Open addressing with double hashing) from Knuth's TAOCP page 528.
    • Nested Class Summary

      • Nested classes/interfaces inherited from class java.util.AbstractMap

        java.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V>
      • Nested classes/interfaces inherited from interface java.util.Map

        java.util.Map.Entry<K,V>
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void clear() 
      boolean containsKey(int key) 
      boolean containsKey(java.lang.Object key) 
      java.util.Set<java.util.Map.Entry<java.lang.Integer,java.lang.Double>> entrySet() 
      double get(int key)
      Returns the value to which the specified key is mapped, or Double.NaN if this map contains no mapping for the key.
      java.lang.Double get(java.lang.Object key) 
      int[] getRawKeyTable() 
      byte[] getRawStatusTable() 
      double[] getRawValueTable() 
      static int h(int key)
      Returns a non-negative hash value
      double increment(int key, double delta) 
      double put(int key, double value) 
      java.lang.Double put(java.lang.Integer key, java.lang.Double value) 
      double remove(int key) 
      java.lang.Double remove(java.lang.Object key) 
      int size() 
      • Methods inherited from class java.util.AbstractMap

        containsValue, equals, hashCode, isEmpty, keySet, putAll, toString, values
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.util.Map

        compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
    • Constructor Detail

      • IntDoubleMap

        public IntDoubleMap()
      • IntDoubleMap

        public IntDoubleMap(int capacity)
      • IntDoubleMap

        public IntDoubleMap(java.util.Map<java.lang.Integer,java.lang.Double> collection)
      • IntDoubleMap

        public IntDoubleMap(int capacity,
                            float loadFactor)
    • Method Detail

      • size

        public int size()
        Specified by:
        size in interface java.util.Map<java.lang.Integer,java.lang.Double>
        Overrides:
        size in class java.util.AbstractMap<java.lang.Integer,java.lang.Double>
      • getRawKeyTable

        public int[] getRawKeyTable()
      • getRawValueTable

        public double[] getRawValueTable()
      • getRawStatusTable

        public byte[] getRawStatusTable()
      • put

        public java.lang.Double put(java.lang.Integer key,
                                    java.lang.Double value)
        Specified by:
        put in interface java.util.Map<java.lang.Integer,java.lang.Double>
        Overrides:
        put in class java.util.AbstractMap<java.lang.Integer,java.lang.Double>
      • put

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

        public double increment(int key,
                                double delta)
        Parameters:
        key - the key whose associated value is to be incremented. All non-present keys behave as having an implicit value of zero, in which case the delta value is directly inserted into the map.
        delta - the amount by which to increment the key's stored value.
        Returns:
        the new value stored for the given key
      • get

        public double get(int key)
        Returns the value to which the specified key is mapped, or Double.NaN if this map contains no mapping for the key.
        Parameters:
        key - the key whose associated value is to be returned
        Returns:
        the value to which the specified key is mapped, or Double.NaN if this map contains no mapping for the key
      • get

        public java.lang.Double get(java.lang.Object key)
        Specified by:
        get in interface java.util.Map<java.lang.Integer,java.lang.Double>
        Overrides:
        get in class java.util.AbstractMap<java.lang.Integer,java.lang.Double>
      • remove

        public java.lang.Double remove(java.lang.Object key)
        Specified by:
        remove in interface java.util.Map<java.lang.Integer,java.lang.Double>
        Overrides:
        remove in class java.util.AbstractMap<java.lang.Integer,java.lang.Double>
      • remove

        public double remove(int key)
        Parameters:
        key -
        Returns:
        the old value stored for this key, or Double.NaN if the key was not present in the map
      • clear

        public void clear()
        Specified by:
        clear in interface java.util.Map<java.lang.Integer,java.lang.Double>
        Overrides:
        clear in class java.util.AbstractMap<java.lang.Integer,java.lang.Double>
      • containsKey

        public boolean containsKey(java.lang.Object key)
        Specified by:
        containsKey in interface java.util.Map<java.lang.Integer,java.lang.Double>
        Overrides:
        containsKey in class java.util.AbstractMap<java.lang.Integer,java.lang.Double>
      • containsKey

        public boolean containsKey(int key)
      • h

        public static int h(int key)
        Returns a non-negative hash value
        Parameters:
        key -
        Returns:
      • entrySet

        public java.util.Set<java.util.Map.Entry<java.lang.Integer,java.lang.Double>> entrySet()
        Specified by:
        entrySet in interface java.util.Map<java.lang.Integer,java.lang.Double>
        Specified by:
        entrySet in class java.util.AbstractMap<java.lang.Integer,java.lang.Double>

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.