Package elki.database.datastore.memory
Class ArrayDoubleStore
- java.lang.Object
-
- elki.database.datastore.memory.ArrayDoubleStore
-
- All Implemented Interfaces:
DataStore<java.lang.Double>,DoubleDataStore,WritableDataStore<java.lang.Double>,WritableDoubleDataStore
public class ArrayDoubleStore extends java.lang.Object implements WritableDoubleDataStore
A class to answer representation queries using the stored Array.- Since:
- 0.5.0
- Author:
- Erich Schubert
-
-
Field Summary
Fields Modifier and Type Field Description private double[]dataData arrayprivate doubledefDefault value.private DataStoreIDMapidmapDBID to index map
-
Constructor Summary
Constructors Constructor Description ArrayDoubleStore(int size, DataStoreIDMap idmap)Constructor.ArrayDoubleStore(int size, DataStoreIDMap idmap, double def)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidclear()Clear the storage (resetting it to the default value).voiddelete(DBIDRef id)Delete the contents for a particular ID and notifies the registered listeners.voiddestroy()Deallocate the storage, freeing the memory and notifies the registered listeners.doubledoubleValue(DBIDRef id)Retrieves an object from the storage.java.lang.Doubleget(DBIDRef id)Deprecated.voidincrement(DBIDRef id, double value)Increment the specified value with the specified id in this storage.doubleput(DBIDRef id, double value)Associates the specified value with the specified id in this storage.java.lang.Doubleput(DBIDRef id, java.lang.Double value)Deprecated.doubleputDouble(DBIDRef id, double value)Associates the specified value with the specified id in this storage.
-
-
-
Field Detail
-
data
private double[] data
Data array
-
def
private double def
Default value.
-
idmap
private DataStoreIDMap idmap
DBID to index map
-
-
Constructor Detail
-
ArrayDoubleStore
public ArrayDoubleStore(int size, DataStoreIDMap idmap)Constructor.- Parameters:
size- Sizeidmap- ID map
-
ArrayDoubleStore
public ArrayDoubleStore(int size, DataStoreIDMap idmap, double def)Constructor.- Parameters:
size- Sizeidmap- ID mapdef- Default value
-
-
Method Detail
-
get
@Deprecated public java.lang.Double get(DBIDRef id)
Deprecated.Description copied from interface:DoubleDataStoreGetter, but using objects.- Specified by:
getin interfaceDataStore<java.lang.Double>- Specified by:
getin interfaceDoubleDataStore- Parameters:
id- Database ID.- Returns:
- Object or
null
-
put
@Deprecated public java.lang.Double put(DBIDRef id, java.lang.Double value)
Deprecated.Description copied from interface:WritableDoubleDataStoreSetter, but using objects.- Specified by:
putin interfaceWritableDataStore<java.lang.Double>- Specified by:
putin interfaceWritableDoubleDataStore- Parameters:
id- Database ID.value- Value to store.- Returns:
- previous value
-
doubleValue
public double doubleValue(DBIDRef id)
Description copied from interface:DoubleDataStoreRetrieves an object from the storage.- Specified by:
doubleValuein interfaceDoubleDataStore- Parameters:
id- Database ID.- Returns:
- Double value
-
putDouble
public double putDouble(DBIDRef id, double value)
Description copied from interface:WritableDoubleDataStoreAssociates the specified value with the specified id in this storage. If the storage previously contained a value for the id, the previous value is replaced by the specified value.- Specified by:
putDoublein interfaceWritableDoubleDataStore- Parameters:
id- Database ID.value- Value to store.- Returns:
- previous value
-
put
public double put(DBIDRef id, double value)
Description copied from interface:WritableDoubleDataStoreAssociates the specified value with the specified id in this storage. If the storage previously contained a value for the id, the previous value is replaced by the specified value.- Specified by:
putin interfaceWritableDoubleDataStore- Parameters:
id- Database ID.value- Value to store.- Returns:
- previous value
-
increment
public void increment(DBIDRef id, double value)
Description copied from interface:WritableDoubleDataStoreIncrement the specified value with the specified id in this storage.- Specified by:
incrementin interfaceWritableDoubleDataStore- Parameters:
id- Database ID.value- Value to add to the previous value.
-
clear
public void clear()
Description copied from interface:WritableDataStoreClear the storage (resetting it to the default value).- Specified by:
clearin interfaceWritableDataStore<java.lang.Double>
-
destroy
public void destroy()
Description copied from interface:WritableDataStoreDeallocate the storage, freeing the memory and notifies the registered listeners.- Specified by:
destroyin interfaceWritableDataStore<java.lang.Double>
-
delete
public void delete(DBIDRef id)
Description copied from interface:WritableDataStoreDelete the contents for a particular ID and notifies the registered listeners.- Specified by:
deletein interfaceWritableDataStore<java.lang.Double>- Parameters:
id- Database ID.
-
-