Package com.qfs.dic

Interface IWritableDictionary<K>

Type Parameters:
K - type of the indexed objects
All Superinterfaces:
ICompressible, IDictionary<K>, IMemoryMonitored, Serializable
All Known Subinterfaces:
IConcurrentDictionary<K>, IFixedLengthIntegerArrayDictionary, IWritableDictionary.IDoubleDictionary, IWritableDictionary.IFloatDictionary, IWritableDictionary.IIntegerDictionary, IWritableDictionary.ILongDictionary, IWritableIntegerArrayDictionary
All Known Implementing Classes:
AbstractDictionary, AChristmasDictionary, AChristmasDictionaryArray, AChristmasDictionaryArray.ChristmasDictionaryDoubleArray, AChristmasDictionaryArray.ChristmasDictionaryFloatArray, AChristmasDictionaryArray.ChristmasDictionaryIntegerArray, AChristmasDictionaryArray.ChristmasDictionaryLongArray, AChristmasDictionaryArray.ChristmasDictionaryObjectArray, AFixedLengthIntegerArrayDictionary, BucketedIntegerArrayDictionary, BufferIntegerDictionary, ChristmasDictionary, ChristmasDictionary.ChristmasDictionaryString, ChristmasDictionaryDouble, ChristmasDictionaryFloat, ChristmasDictionaryInteger, ChristmasDictionaryLong, ColumnarIntegerArrayDictionary, Dictionary, FixedLengthIntegerArrayDictionary, IntegerArrayDictionary, IntegerArrayDictionaryWithHash, IntegerArrayPermutationDictionary, IntegerDictionary, LocationDictionary, LongDictionary, NullableDictionary, PackedIntDictionary, PairDictionary, SharedDelegateDictionary, StrategyDictionary, StringDictionary, TranslatedIntegerArrayDictionary, TupleDictionary

public interface IWritableDictionary<K> extends IDictionary<K>
A dictionary into which new keys can be written, using the map function.

All dictionary implementations support concurrent read and write operations. It is possible for several threads to read the dictionary while at the same time a single thread writes into the dictionary.
Some dictionaries qualified as concurrent dictionaries also support multiple threads writing into the dictionary at the same time.

Author:
ActiveViam
  • Method Details

    • supportConcurrentWrites

      boolean supportConcurrentWrites()
      Returns whether the dictionary supports concurrent writing (Multiple Writer/Multiple Reader) or not.
      Returns:
      true if the dictionary supports concurrent writing, false otherwise
      See Also:
    • map

      int map(K object)
      Indexes a new object in the dictionary.

      If the object already existed in the dictionary (with respect to the equals / hashCode contract) the previous copy of the object is left in the dictionary. The new object copy can then be safely reused or cleared without any impact to the dictionary consistency.

      Parameters:
      object - the object
      Returns:
      the address of the object in the dictionary buffer
    • mapInt

      int mapInt(int key)
      Indexes an integer as a new key in the dictionary.

      If the key already existed in the dictionary (with respect to the equals / hashCode contract) the previous copy of the object is left in the dictionary. The new object copy can then be safely reused or cleared without any impact to the dictionary consistency.

      This will throw UnsupportedOperationException if the type Integer is not compatible with the type of the dictionary.

      Parameters:
      key - the integer to map
      Returns:
      the address of the object in the dictionary buffer
    • mapLong

      int mapLong(long key)
      Indexes a long as a new key in the dictionary.

      If the key already existed in the dictionary (with respect to the equals / hashCode contract) the previous copy of the object is left in the dictionary. The new object copy can then be safely reused or cleared without any impact to the dictionary consistency.

      This will throw UnsupportedOperationException if the type Long is not compatible with the type of the dictionary.

      Parameters:
      key - the long to map
      Returns:
      the address of the object in the dictionary buffer
    • mapFloat

      int mapFloat(float key)
      Indexes a float as a new key in the dictionary.

      If the key already existed in the dictionary (with respect to the equals / hashCode contract) the previous copy of the object is left in the dictionary. The new object copy can then be safely reused or cleared without any impact to the dictionary consistency.

      This will throw UnsupportedOperationException if the type Float is not compatible with the type of the dictionary.

      Parameters:
      key - the float to map
      Returns:
      the address of the object in the dictionary buffer
    • mapDouble

      int mapDouble(double key)
      Indexes a double as a new key in the dictionary.

      If the key already existed in the dictionary (with respect to the equals / hashCode contract) the previous copy of the object is left in the dictionary. The new object copy can then be safely reused or cleared without any impact to the dictionary consistency.

      This will throw UnsupportedOperationException if the type Double is not compatible with the type of the dictionary.

      Parameters:
      key - the double to map
      Returns:
      the address of the object in the dictionary buffer
    • mapFromCell

      int mapFromCell(IReadableCell cell)
      Maps the value stored by a cell into this dictionary.
      Parameters:
      cell - cell containing the value to map
      Returns:
      the dictionary position for the mapped value
    • clear

      void clear()
      Clears the whole content of the dictionary.

      This operation will not recreate or resize the internal data structures of the dictionary, but erase them.

    • destroy

      void destroy()
      Frees all resources held by this data structure.