Package elki.database.datastore.memory
Class ArrayRecordStore
- java.lang.Object
-
- elki.database.datastore.memory.ArrayRecordStore
-
- All Implemented Interfaces:
RecordStore
,WritableRecordStore
public class ArrayRecordStore extends java.lang.Object implements WritableRecordStore
A class to answer representation queries using the stored Array.- Since:
- 0.4.0
- Author:
- Erich Schubert
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
ArrayRecordStore.StorageAccessor<T>
Access a single record in the given data.
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Object[][]
data
Data arrayprivate DataStoreIDMap
idmap
DBID to index map
-
Constructor Summary
Constructors Constructor Description ArrayRecordStore(java.lang.Object[][] data, DataStoreIDMap idmap)
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
-
-
-
Field Detail
-
data
private final java.lang.Object[][] data
Data array
-
idmap
private final DataStoreIDMap idmap
DBID to index map
-
-
Constructor Detail
-
ArrayRecordStore
public ArrayRecordStore(java.lang.Object[][] data, DataStoreIDMap idmap)
Constructor with existing data- Parameters:
data
- Existing dataidmap
- Map for array offsets
-
-
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- Parameters:
id
- Database IDindex
- column index- Returns:
- current value
-
set
protected <T> T set(DBIDRef id, int index, T value)
Actual setter- Parameters:
id
- Database IDindex
- column indexvalue
- New value- Returns:
- old 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
-
-