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 ArrayModifiableDBIDs
data
Data arrayprivate DataStoreIDMap
idmap
DBID 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 DBIDVar
assignVar(DBIDRef id, DBIDVar var)
Retrieves an object from the storage.void
clear()
Clear the storage (resetting it to the default value).void
delete(DBIDRef id)
Delete the contents for a particular ID and notifies the registered listeners.void
destroy()
Deallocate the storage, freeing the memory and notifies the registered listeners.DBID
get(DBIDRef id)
Deprecated.DBID
put(DBIDRef id, DBID value)
Deprecated.void
put(DBIDRef id, DBIDRef value)
Associates the specified value with the specified id in this storage.void
putDBID(DBIDRef id, DBIDRef value)
Associates the specified value with the specified id in this storage.java.lang.String
toString()
-
-
-
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:DBIDDataStore
Getter, but using objects.- Specified by:
get
in interfaceDataStore<DBID>
- Specified by:
get
in interfaceDBIDDataStore
- Parameters:
id
- Database ID.- Returns:
- Object or
null
-
assignVar
public DBIDVar assignVar(DBIDRef id, DBIDVar var)
Description copied from interface:DBIDDataStore
Retrieves an object from the storage.- Specified by:
assignVar
in 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:WritableDBIDDataStore
Setter, but using materialized DBIDs.- Specified by:
put
in interfaceWritableDataStore<DBID>
- Specified by:
put
in interfaceWritableDBIDDataStore
- Parameters:
id
- Database ID.value
- Value to store.- Returns:
- previous value
-
putDBID
public void putDBID(DBIDRef id, DBIDRef value)
Description copied from interface:WritableDBIDDataStore
Associates 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:
putDBID
in interfaceWritableDBIDDataStore
- Parameters:
id
- Database ID.value
- Value to store.
-
put
public void put(DBIDRef id, DBIDRef value)
Description copied from interface:WritableDBIDDataStore
Associates 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:
put
in interfaceWritableDBIDDataStore
- Parameters:
id
- Database ID.value
- Value to store.
-
destroy
public void destroy()
Description copied from interface:WritableDataStore
Deallocate the storage, freeing the memory and notifies the registered listeners.- Specified by:
destroy
in interfaceWritableDataStore<DBID>
-
clear
public void clear()
Description copied from interface:WritableDataStore
Clear the storage (resetting it to the default value).- Specified by:
clear
in interfaceWritableDataStore<DBID>
-
delete
public void delete(DBIDRef id)
Description copied from interface:WritableDataStore
Delete the contents for a particular ID and notifies the registered listeners.- Specified by:
delete
in interfaceWritableDataStore<DBID>
- Parameters:
id
- Database ID.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-