Package elki.database.datastore.memory
Class MapIntegerDBIDRecordStore
- java.lang.Object
-
- elki.database.datastore.memory.MapIntegerDBIDRecordStore
-
- All Implemented Interfaces:
RecordStore
,WritableRecordStore
public class MapIntegerDBIDRecordStore extends java.lang.Object implements WritableRecordStore
A class to answer representation queries using a map and an index within the record.- Since:
- 0.4.0
- Author:
- Erich Schubert
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
MapIntegerDBIDRecordStore.StorageAccessor<T>
Access a single record in the given data.
-
Constructor Summary
Constructors Constructor Description MapIntegerDBIDRecordStore(int rlen)
Constructor without existing data.MapIntegerDBIDRecordStore(int size, int rlen)
Constructor without existing data.MapIntegerDBIDRecordStore(int rlen, it.unimi.dsi.fastutil.ints.Int2ObjectMap<java.lang.Object[]> data)
Constructor with existing data.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected <T> T
get(DBIDRef id, int index)
Actual getter.<T> WritableDataStore<T>
getStorage(int col, java.lang.Class<? super T> datatype)
Get aWritableDataStore
instance for a particular record column.boolean
remove(DBIDRef id)
Remove an object from the store, all columns.protected <T> T
set(DBIDRef id, int index, T value)
Actual setter.
-
-
-
Constructor Detail
-
MapIntegerDBIDRecordStore
public MapIntegerDBIDRecordStore(int rlen, it.unimi.dsi.fastutil.ints.Int2ObjectMap<java.lang.Object[]> data)
Constructor with existing data.- Parameters:
rlen
- Number of columns (record length)data
- Existing data map
-
MapIntegerDBIDRecordStore
public MapIntegerDBIDRecordStore(int rlen)
Constructor without existing data.- Parameters:
rlen
- Number of columns (record length)
-
MapIntegerDBIDRecordStore
public MapIntegerDBIDRecordStore(int size, int rlen)
Constructor without existing data.- Parameters:
size
- Expected sizerlen
- Number of columns (record length)
-
-
Method Detail
-
getStorage
public <T> WritableDataStore<T> getStorage(int col, java.lang.Class<? super T> datatype)
Description copied from interface:WritableRecordStore
Get aWritableDataStore
instance for a particular record column.- Specified by:
getStorage
in interfaceRecordStore
- Specified by:
getStorage
in interfaceWritableRecordStore
- Type Parameters:
T
- Data type- Parameters:
col
- Column numberdatatype
- data class- Returns:
- writable storage
-
get
protected <T> T get(DBIDRef id, int index)
Actual getter.- Type Parameters:
T
- type- Parameters:
id
- Database IDindex
- column index- Returns:
- current value
-
set
protected <T> T set(DBIDRef id, int index, T value)
Actual setter.- Type Parameters:
T
- type- Parameters:
id
- Database IDindex
- column indexvalue
- new value- Returns:
- previous value
-
remove
public boolean remove(DBIDRef id)
Description copied from interface:WritableRecordStore
Remove an object from the store, all columns.- Specified by:
remove
in interfaceWritableRecordStore
- Parameters:
id
- object ID to remove- Returns:
- success code
-
-