Package elki.database.datastore.memory
Class ArrayDBIDStore
- java.lang.Object
-
- elki.database.datastore.memory.ArrayDBIDStore
-
- All Implemented Interfaces:
DataStore<DBID>,DBIDDataStore,WritableDataStore<DBID>,WritableDBIDDataStore
public class ArrayDBIDStore extends java.lang.Object implements WritableDBIDDataStore
A class to answer representation queries using the stored Array.- Since:
- 0.5.5
- Author:
- Erich Schubert
-
-
Field Summary
Fields Modifier and Type Field Description private ArrayModifiableDBIDsdataData arrayprivate DataStoreIDMapidmapDBID to index map
-
Constructor Summary
Constructors Constructor Description ArrayDBIDStore(int size, DataStoreIDMap idmap)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description DBIDVarassignVar(DBIDRef id, DBIDVar var)Retrieves an object from the storage.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.DBIDget(DBIDRef id)Deprecated.DBIDput(DBIDRef id, DBID value)Deprecated.voidput(DBIDRef id, DBIDRef value)Associates the specified value with the specified id in this storage.voidputDBID(DBIDRef id, DBIDRef value)Associates the specified value with the specified id in this storage.java.lang.StringtoString()
-
-
-
Field Detail
-
data
private ArrayModifiableDBIDs data
Data array
-
idmap
private DataStoreIDMap idmap
DBID to index map
-
-
Constructor Detail
-
ArrayDBIDStore
public ArrayDBIDStore(int size, DataStoreIDMap idmap)Constructor.- Parameters:
size- Sizeidmap- ID map
-
-
Method Detail
-
get
@Deprecated public DBID get(DBIDRef id)
Deprecated.Description copied from interface:DBIDDataStoreGetter, but using objects.- Specified by:
getin interfaceDataStore<DBID>- Specified by:
getin interfaceDBIDDataStore- Parameters:
id- Database ID.- Returns:
- Object or
null
-
assignVar
public DBIDVar assignVar(DBIDRef id, DBIDVar var)
Description copied from interface:DBIDDataStoreRetrieves an object from the storage.- Specified by:
assignVarin interfaceDBIDDataStore- Parameters:
id- Database ID.var- Variable to update.- Returns:
var
-
put
@Deprecated public DBID put(DBIDRef id, DBID value)
Deprecated.Description copied from interface:WritableDBIDDataStoreSetter, but using materialized DBIDs.- Specified by:
putin interfaceWritableDataStore<DBID>- Specified by:
putin interfaceWritableDBIDDataStore- Parameters:
id- Database ID.value- Value to store.- Returns:
- previous value
-
putDBID
public void putDBID(DBIDRef id, DBIDRef value)
Description copied from interface:WritableDBIDDataStoreAssociates 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:
putDBIDin interfaceWritableDBIDDataStore- Parameters:
id- Database ID.value- Value to store.
-
put
public void put(DBIDRef id, DBIDRef value)
Description copied from interface:WritableDBIDDataStoreAssociates 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 interfaceWritableDBIDDataStore- Parameters:
id- Database ID.value- Value to store.
-
destroy
public void destroy()
Description copied from interface:WritableDataStoreDeallocate the storage, freeing the memory and notifies the registered listeners.- Specified by:
destroyin interfaceWritableDataStore<DBID>
-
clear
public void clear()
Description copied from interface:WritableDataStoreClear the storage (resetting it to the default value).- Specified by:
clearin interfaceWritableDataStore<DBID>
-
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<DBID>- Parameters:
id- Database ID.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-