Class ArrayIntegerStore

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private int[] data
      Data array
      private int def
      Default value (for clear()).
      private DataStoreIDMap idmap
      DBID to index map
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      void clear()
      Clear the storage (resetting it to the default value).
      void delete​(DBIDRef id)
      Delete the contents for a particular ID and notifies the registered listeners.
      void destroy()
      Deallocate the storage, freeing the memory and notifies the registered listeners.
      java.lang.Integer get​(DBIDRef id)
      Deprecated.
      void increment​(DBIDRef id, int adjust)
      Increment a value.
      int intValue​(DBIDRef id)
      Retrieves a value from the storage.
      int put​(DBIDRef id, int value)
      Associates the specified value with the specified id in this storage.
      java.lang.Integer put​(DBIDRef id, java.lang.Integer value)
      Deprecated.
      int putInt​(DBIDRef id, int value)
      Associates the specified value with the specified id in this storage.
      • Methods inherited from class java.lang.Object

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

      • data

        private int[] data
        Data array
      • def

        private int def
        Default value (for clear()).
    • Constructor Detail

      • ArrayIntegerStore

        public ArrayIntegerStore​(int size,
                                 DataStoreIDMap idmap)
        Constructor.
        Parameters:
        size - Size
        idmap - ID map
      • ArrayIntegerStore

        public ArrayIntegerStore​(int size,
                                 DataStoreIDMap idmap,
                                 int def)
        Constructor.
        Parameters:
        size - Size
        idmap - ID map
        def - Default value
    • Method Detail

      • get

        @Deprecated
        public java.lang.Integer get​(DBIDRef id)
        Deprecated.
        Description copied from interface: IntegerDataStore
        Getter, but using objects.
        Specified by:
        get in interface DataStore<java.lang.Integer>
        Specified by:
        get in interface IntegerDataStore
        Parameters:
        id - Database ID.
        Returns:
        Object or null
      • put

        @Deprecated
        public java.lang.Integer put​(DBIDRef id,
                                     java.lang.Integer value)
        Deprecated.
        Description copied from interface: WritableIntegerDataStore
        Setter, but using objects.
        Specified by:
        put in interface WritableDataStore<java.lang.Integer>
        Specified by:
        put in interface WritableIntegerDataStore
        Parameters:
        id - Database ID.
        value - Value to store.
        Returns:
        previous value
      • intValue

        public int intValue​(DBIDRef id)
        Description copied from interface: IntegerDataStore
        Retrieves a value from the storage.
        Specified by:
        intValue in interface IntegerDataStore
        Parameters:
        id - Database ID.
        Returns:
        Double value
      • putInt

        public int putInt​(DBIDRef id,
                          int value)
        Description copied from interface: WritableIntegerDataStore
        Associates the specified value with the specified id in this storage. If the storage previously contained a value for the id, the previous value is replaced by the specified value.
        Specified by:
        putInt in interface WritableIntegerDataStore
        Parameters:
        id - Database ID.
        value - Value to store.
        Returns:
        previous value
      • put

        public int put​(DBIDRef id,
                       int value)
        Description copied from interface: WritableIntegerDataStore
        Associates the specified value with the specified id in this storage. If the storage previously contained a value for the id, the previous value is replaced by the specified value.
        Specified by:
        put in interface WritableIntegerDataStore
        Parameters:
        id - Database ID.
        value - Value to store.
        Returns:
        previous value
      • destroy

        public void destroy()
        Description copied from interface: WritableDataStore
        Deallocate the storage, freeing the memory and notifies the registered listeners.
        Specified by:
        destroy in interface WritableDataStore<java.lang.Integer>
      • delete

        public void delete​(DBIDRef id)
        Description copied from interface: WritableDataStore
        Delete the contents for a particular ID and notifies the registered listeners.
        Specified by:
        delete in interface WritableDataStore<java.lang.Integer>
        Parameters:
        id - Database ID.
      • clear

        public void clear()
        Description copied from interface: WritableDataStore
        Clear the storage (resetting it to the default value).
        Specified by:
        clear in interface WritableDataStore<java.lang.Integer>