Class MaterializedRelation<O>

  • Type Parameters:
    O - Data type
    All Implemented Interfaces:
    elki.database.relation.ModifiableRelation<O>, elki.database.relation.Relation<O>

    public class MaterializedRelation<O>
    extends java.lang.Object
    implements elki.database.relation.ModifiableRelation<O>
    Represents a single representation. This is attached to a DBIDs object, which you are supposed to manage first. I.e. put the new DBID in, then invoke set(), remove the DBID, then delete().

    TODO: is this semantic sane?

    Since:
    0.4.0
    Author:
    Erich Schubert
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private elki.database.datastore.DataStore<O> content
      Map to hold the objects of the database.
      private elki.database.ids.StaticDBIDs ids
      The DBIDs this is supposed to be defined for.
      private java.lang.String name
      The relation name.
      private elki.data.type.SimpleTypeInformation<O> type
      The class of objects we store.
    • Constructor Summary

      Constructors 
      Constructor Description
      MaterializedRelation​(elki.data.type.SimpleTypeInformation<O> type, elki.database.ids.DBIDs ids)
      Constructor.
      MaterializedRelation​(java.lang.String name, elki.data.type.SimpleTypeInformation<O> type, elki.database.ids.DBIDs ids)
      Constructor.
      MaterializedRelation​(java.lang.String name, elki.data.type.SimpleTypeInformation<O> type, elki.database.ids.DBIDs ids, elki.database.datastore.DataStore<O> content)
      Constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void delete​(elki.database.ids.DBIDRef id)
      Delete an objects values.
      O get​(elki.database.ids.DBIDRef id)  
      elki.data.type.SimpleTypeInformation<O> getDataTypeInformation()  
      elki.database.ids.StaticDBIDs getDBIDs()  
      java.lang.String getLongName()  
      void insert​(elki.database.ids.DBIDRef id, O val)  
      elki.database.ids.DBIDIter iterDBIDs()  
      int size()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface elki.database.relation.Relation

        forEach
    • Field Detail

      • type

        private final elki.data.type.SimpleTypeInformation<O> type
        The class of objects we store.
      • content

        private final elki.database.datastore.DataStore<O> content
        Map to hold the objects of the database.
      • ids

        private final elki.database.ids.StaticDBIDs ids
        The DBIDs this is supposed to be defined for. Note: we only keep an unmodifiable reference.
      • name

        private java.lang.String name
        The relation name.
    • Constructor Detail

      • MaterializedRelation

        public MaterializedRelation​(elki.data.type.SimpleTypeInformation<O> type,
                                    elki.database.ids.DBIDs ids)
        Constructor.
        Parameters:
        type - Type information
        ids - IDs
      • MaterializedRelation

        public MaterializedRelation​(java.lang.String name,
                                    elki.data.type.SimpleTypeInformation<O> type,
                                    elki.database.ids.DBIDs ids)
        Constructor.
        Parameters:
        name - Name
        type - Type information
        ids - IDs
      • MaterializedRelation

        public MaterializedRelation​(java.lang.String name,
                                    elki.data.type.SimpleTypeInformation<O> type,
                                    elki.database.ids.DBIDs ids,
                                    elki.database.datastore.DataStore<O> content)
        Constructor.
        Parameters:
        name - Name
        type - Type information
        ids - IDs
        content - Content
    • Method Detail

      • get

        public O get​(elki.database.ids.DBIDRef id)
        Specified by:
        get in interface elki.database.relation.Relation<O>
      • insert

        public void insert​(elki.database.ids.DBIDRef id,
                           O val)
        Specified by:
        insert in interface elki.database.relation.ModifiableRelation<O>
      • delete

        public void delete​(elki.database.ids.DBIDRef id)
        Delete an objects values.
        Specified by:
        delete in interface elki.database.relation.ModifiableRelation<O>
        Parameters:
        id - ID to delete
      • getDBIDs

        public elki.database.ids.StaticDBIDs getDBIDs()
        Specified by:
        getDBIDs in interface elki.database.relation.Relation<O>
      • iterDBIDs

        public elki.database.ids.DBIDIter iterDBIDs()
        Specified by:
        iterDBIDs in interface elki.database.relation.Relation<O>
      • size

        public int size()
        Specified by:
        size in interface elki.database.relation.Relation<O>
      • getDataTypeInformation

        public elki.data.type.SimpleTypeInformation<O> getDataTypeInformation()
        Specified by:
        getDataTypeInformation in interface elki.database.relation.Relation<O>
      • getLongName

        public java.lang.String getLongName()
        Specified by:
        getLongName in interface elki.database.relation.Relation<O>