Class 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
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private it.unimi.dsi.fastutil.ints.Int2ObjectMap<java.lang.Object[]> data
      Storage Map.
      private int rlen
      Record length.
    • 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

      • rlen

        private final int rlen
        Record length.
      • data

        private final it.unimi.dsi.fastutil.ints.Int2ObjectMap<java.lang.Object[]> data
        Storage Map.
    • 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 size
        rlen - Number of columns (record length)
    • Method Detail

      • get

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