de.lmu.ifi.dbs.elki.database.datastore.memory
Class ArrayRecordStore

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.database.datastore.memory.ArrayRecordStore
All Implemented Interfaces:
RecordStore, WritableRecordStore

public class ArrayRecordStore
extends Object
implements WritableRecordStore

A class to answer representation queries using the stored Array.


Nested Class Summary
protected  class ArrayRecordStore.StorageAccessor<T>
          Access a single record in the given data.
 
Field Summary
private  Object[][] data
          Data array
private  DataStoreIDMap idmap
          DBID to index map
 
Constructor Summary
ArrayRecordStore(Object[][] data, DataStoreIDMap idmap)
          Constructor with existing data
 
Method Summary
protected
<T> T
get(DBID id, int index)
          Actual getter
<T> WritableDataStore<T>
getStorage(int col, Class<? super T> datatype)
          Get a WritableDataStore instance for a particular record column.
 boolean remove(DBID id)
          Remove an object from the store, all columns.
protected
<T> T
set(DBID id, int index, T value)
          Actual setter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

data

private final Object[][] data
Data array


idmap

private final DataStoreIDMap idmap
DBID to index map

Constructor Detail

ArrayRecordStore

public ArrayRecordStore(Object[][] data,
                        DataStoreIDMap idmap)
Constructor with existing data

Parameters:
data - Existing data
idmap - Map for array offsets
Method Detail

getStorage

public <T> WritableDataStore<T> getStorage(int col,
                                           Class<? super T> datatype)
Description copied from interface: WritableRecordStore
Get a WritableDataStore instance for a particular record column.

Specified by:
getStorage in interface RecordStore
Specified by:
getStorage in interface WritableRecordStore
Type Parameters:
T - Data type
Parameters:
col - Column number
datatype - data class
Returns:
writable storage

get

protected <T> T get(DBID id,
                    int index)
Actual getter

Parameters:
id - Database ID
index - column index
Returns:
current value

set

protected <T> T set(DBID id,
                    int index,
                    T value)
Actual setter

Parameters:
id - Database ID
index - column index
value - New value
Returns:
old value

remove

public boolean remove(DBID id)
Description copied from interface: WritableRecordStore
Remove an object from the store, all columns.

Specified by:
remove in interface WritableRecordStore
Parameters:
id - object ID to remove
Returns:
success code

Release 0.4.0 (2011-09-20_1324)