Package elki.database.relation
Class MaterializedDoubleRelation
- java.lang.Object
-
- elki.database.relation.MaterializedDoubleRelation
-
- All Implemented Interfaces:
DoubleRelation,ModifiableRelation<java.lang.Double>,Relation<java.lang.Double>
public class MaterializedDoubleRelation extends java.lang.Object implements DoubleRelation
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().- Since:
- 0.4.0
- Author:
- Erich Schubert
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface elki.database.relation.DoubleRelation
DoubleRelation.Consumer
-
-
Field Summary
Fields Modifier and Type Field Description private DoubleDataStorecontentMap to hold the objects of the database.private StaticDBIDsidsThe DBIDs this is supposed to be defined for.private java.lang.StringnameThe relation name.
-
Constructor Summary
Constructors Constructor Description MaterializedDoubleRelation(java.lang.String name, DBIDs ids)Constructor.MaterializedDoubleRelation(java.lang.String name, DBIDs ids, DoubleDataStore content)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voiddelete(DBIDRef id)Delete an objects values.doubledoubleValue(DBIDRef id)Get the representation of an object.SimpleTypeInformation<java.lang.Double>getDataTypeInformation()Get the data type of this representationStaticDBIDsgetDBIDs()Get the IDs the query is defined for.java.lang.StringgetLongName()Get a long (human readable) name for the relation.voidinsert(DBIDRef id, java.lang.Double val)Deprecated.DBIDIteriterDBIDs()Get an iterator access to the DBIDs.voidset(DBIDRef id, double val)Set an object representation.intsize()Get the number of DBIDs.-
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.DoubleRelation
forEachDouble, get
-
-
-
-
Field Detail
-
content
private final DoubleDataStore content
Map to hold the objects of the database.
-
ids
private final 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
-
MaterializedDoubleRelation
public MaterializedDoubleRelation(java.lang.String name, DBIDs ids)Constructor.- Parameters:
name- Nameids- IDs
-
MaterializedDoubleRelation
public MaterializedDoubleRelation(java.lang.String name, DBIDs ids, DoubleDataStore content)Constructor.- Parameters:
name- Nameids- IDscontent- Content
-
-
Method Detail
-
doubleValue
public double doubleValue(DBIDRef id)
Description copied from interface:DoubleRelationGet the representation of an object.- Specified by:
doubleValuein interfaceDoubleRelation- Parameters:
id- Object ID- Returns:
- object instance
-
set
public void set(DBIDRef id, double val)
Description copied from interface:DoubleRelationSet an object representation.- Specified by:
setin interfaceDoubleRelation- Parameters:
id- Object IDval- Value
-
insert
@Deprecated public void insert(DBIDRef id, java.lang.Double val)
Deprecated.Description copied from interface:ModifiableRelationSet (or insert) an object representation.- Specified by:
insertin interfaceDoubleRelation- Specified by:
insertin interfaceModifiableRelation<java.lang.Double>- Parameters:
id- Object IDval- Value
-
delete
public void delete(DBIDRef id)
Delete an objects values.- Specified by:
deletein interfaceModifiableRelation<java.lang.Double>- Parameters:
id- ID to delete
-
getDBIDs
public StaticDBIDs getDBIDs()
Description copied from interface:RelationGet the IDs the query is defined for.If possible, prefer
Relation.iterDBIDs().
-
iterDBIDs
public DBIDIter iterDBIDs()
Description copied from interface:RelationGet an iterator access to the DBIDs.To iterate over all IDs, use the following code fragment:
for(DBIDIter iter = relation.iterDBIDs(); iter.valid(); iter.advance()) { relation.get(iter); // Get the current element }
-
size
public int size()
Description copied from interface:RelationGet the number of DBIDs.
-
getDataTypeInformation
public SimpleTypeInformation<java.lang.Double> getDataTypeInformation()
Description copied from interface:RelationGet the data type of this representation- Specified by:
getDataTypeInformationin interfaceRelation<java.lang.Double>- Returns:
- Data type
-
getLongName
public java.lang.String getLongName()
Description copied from interface:RelationGet a long (human readable) name for the relation.- Specified by:
getLongNamein interfaceRelation<java.lang.Double>- Returns:
- Relation name
-
-