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
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
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceSpecialized dictionary interface for dictionaries of Doubles.static interfaceSpecialized dictionary interface for dictionaries of Floats.static interfaceSpecialized dictionary interface for dictionaries of integers.static interfaceSpecialized dictionary interface for dictionaries of Longs. -
Field Summary
Fields inherited from interface com.qfs.dic.IDictionary
DEFAULT_INITIAL_CAPACITY, ID_GENERATOR -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Clears the whole content of the dictionary.voiddestroy()Frees all resources held by this data structure.intIndexes a new object in the dictionary.intmapDouble(double key) Indexes a double as a new key in the dictionary.intmapFloat(float key) Indexes a float as a new key in the dictionary.intmapFromCell(IReadableCell cell) Maps the value stored by a cell into this dictionary.intmapInt(int key) Indexes an integer as a new key in the dictionary.intmapLong(long key) Indexes a long as a new key in the dictionary.booleanReturns whether the dictionary supports concurrent writing (Multiple Writer/Multiple Reader) or not.Methods inherited from interface com.qfs.memory.ICompressible
compress, compressMethods inherited from interface com.qfs.dic.IDictionary
copyInto, getDictionaryId, getDoublePosition, getFirstElements, getFloatPosition, getIntPosition, getLongPosition, getOrder, getPosition, getSize, getType, isNullable, read, readDouble, readFloat, readInt, readLong, size, supportConcurrentReadsMethods inherited from interface com.qfs.monitoring.memory.IMemoryMonitored
getMemoryStatistic
-
Method Details
-
supportConcurrentWrites
boolean supportConcurrentWrites()Returns whether the dictionary supports concurrent writing (Multiple Writer/Multiple Reader) or not.- Returns:
trueif the dictionary supports concurrent writing,falseotherwise- See Also:
-
map
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
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.
-