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 DoubleDataStore
content
Map to hold the objects of the database.private StaticDBIDs
ids
The DBIDs this is supposed to be defined for.private java.lang.String
name
The 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 void
delete(DBIDRef id)
Delete an objects values.double
doubleValue(DBIDRef id)
Get the representation of an object.SimpleTypeInformation<java.lang.Double>
getDataTypeInformation()
Get the data type of this representationStaticDBIDs
getDBIDs()
Get the IDs the query is defined for.java.lang.String
getLongName()
Get a long (human readable) name for the relation.void
insert(DBIDRef id, java.lang.Double val)
Deprecated.DBIDIter
iterDBIDs()
Get an iterator access to the DBIDs.void
set(DBIDRef id, double val)
Set an object representation.int
size()
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:DoubleRelation
Get the representation of an object.- Specified by:
doubleValue
in interfaceDoubleRelation
- Parameters:
id
- Object ID- Returns:
- object instance
-
set
public void set(DBIDRef id, double val)
Description copied from interface:DoubleRelation
Set an object representation.- Specified by:
set
in interfaceDoubleRelation
- Parameters:
id
- Object IDval
- Value
-
insert
@Deprecated public void insert(DBIDRef id, java.lang.Double val)
Deprecated.Description copied from interface:ModifiableRelation
Set (or insert) an object representation.- Specified by:
insert
in interfaceDoubleRelation
- Specified by:
insert
in interfaceModifiableRelation<java.lang.Double>
- Parameters:
id
- Object IDval
- Value
-
delete
public void delete(DBIDRef id)
Delete an objects values.- Specified by:
delete
in interfaceModifiableRelation<java.lang.Double>
- Parameters:
id
- ID to delete
-
getDBIDs
public StaticDBIDs getDBIDs()
Description copied from interface:Relation
Get the IDs the query is defined for.If possible, prefer
Relation.iterDBIDs()
.
-
iterDBIDs
public DBIDIter iterDBIDs()
Description copied from interface:Relation
Get 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:Relation
Get the number of DBIDs.
-
getDataTypeInformation
public SimpleTypeInformation<java.lang.Double> getDataTypeInformation()
Description copied from interface:Relation
Get the data type of this representation- Specified by:
getDataTypeInformation
in interfaceRelation<java.lang.Double>
- Returns:
- Data type
-
getLongName
public java.lang.String getLongName()
Description copied from interface:Relation
Get a long (human readable) name for the relation.- Specified by:
getLongName
in interfaceRelation<java.lang.Double>
- Returns:
- Relation name
-
-