Class 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 array
      private 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 a WritableDataStore 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
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • data

        private final java.lang.Object[][] data
        Data array
    • Constructor Detail

      • ArrayRecordStore

        public ArrayRecordStore​(java.lang.Object[][] data,
                                DataStoreIDMap idmap)
        Constructor with existing data
        Parameters:
        data - Existing data
        idmap - Map for array offsets
    • Method Detail

      • get

        protected <T> T get​(DBIDRef id,
                            int index)
        Actual getter
        Parameters:
        id - Database ID
        index - column index
        Returns:
        current value
      • set

        protected <T> T set​(DBIDRef id,
                            int index,
                            T value)
        Actual setter
        Parameters:
        id - Database ID
        index - column index
        value - 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 interface WritableRecordStore
        Parameters:
        id - object ID to remove
        Returns:
        success code