程序包 org.hipparchus.util

类 OpenIntToDoubleHashMap

java.lang.Object
org.hipparchus.util.OpenIntToDoubleHashMap
所有已实现的接口:
Serializable

public class OpenIntToDoubleHashMap extends Object implements Serializable
Open addressed map from int to double.

This class provides a dedicated map from integers to doubles with a much smaller memory overhead than standard java.util.Map.

This class is not synchronized. The specialized iterators returned by iterator() are fail-fast: they throw a ConcurrentModificationException when they detect the map has been modified during iteration.

另请参阅:
  • 字段详细资料

    • FREE

      protected static final byte FREE
      Status indicator for free table entries.
      另请参阅:
    • FULL

      protected static final byte FULL
      Status indicator for full table entries.
      另请参阅:
    • REMOVED

      protected static final byte REMOVED
      Status indicator for removed table entries.
      另请参阅:
  • 构造器详细资料

    • OpenIntToDoubleHashMap

      public OpenIntToDoubleHashMap()
      Build an empty map with default size and using NaN for missing entries.
    • OpenIntToDoubleHashMap

      public OpenIntToDoubleHashMap(double missingEntries)
      Build an empty map with default size
      参数:
      missingEntries - 当获取缺失条目时返回的值
    • OpenIntToDoubleHashMap

      public OpenIntToDoubleHashMap(int expectedSize)
      Build an empty map with specified size and using NaN for missing entries.
      参数:
      expectedSize - 预期的元素数量
    • OpenIntToDoubleHashMap

      public OpenIntToDoubleHashMap(int expectedSize, double missingEntries)
      Build an empty map with specified size.
      参数:
      expectedSize - 预期的元素数量
      missingEntries - 当获取缺失条目时返回的值
    • OpenIntToDoubleHashMap

      public OpenIntToDoubleHashMap(OpenIntToDoubleHashMap source)
      Copy constructor.
      参数:
      source - 要复制的映射
  • 方法详细资料

    • get

      public double get(int key)
      Get the stored value associated with the given key
      参数:
      key - 与数据关联的键
      返回:
      与键关联的数据
    • containsKey

      public boolean containsKey(int key)
      Check if a value is associated with a key.
      参数:
      key - 要检查的键
      返回:
      如果与键关联了值,则为true
    • iterator

      public OpenIntToDoubleHashMap.Iterator iterator()
      Get an iterator over map elements.

      返回的专用迭代器是快速失败的: 在迭代期间检测到映射已被修改时,它们会抛出ConcurrentModificationException

      返回:
      映射元素的迭代器
    • size

      public int size()
      Get the number of elements stored in the map.
      返回:
      存储在映射中的元素数量
    • remove

      public double remove(int key)
      Remove the value associated with a key.
      参数:
      key - 与值关联的键
      返回:
      已移除的值
    • put

      public double put(int key, double value)
      Put a value associated with a key in the map.
      参数:
      key - 与值关联的键
      value - 要放入映射中的值
      返回:
      与键关联的先前值