public abstract class AbstractDatabase extends AbstractHierarchicalResult implements Database
Note: when debugging index usage, set logging for this package to FINEST via -enableDebug de.lmu.ifi.dbs.elki.database=FINEST
Modifier and Type | Class and Description |
---|---|
static class |
AbstractDatabase.Parameterizer
Parameterization class.
|
Modifier and Type | Field and Description |
---|---|
protected DatabaseEventManager |
eventManager
The event manager, collects events and fires them on demand.
|
protected java.util.Collection<IndexFactory<?>> |
indexFactories
Index factories.
|
protected java.util.List<Relation<?>> |
relations
The relations we manage.
|
Constructor and Description |
---|
AbstractDatabase()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
accumulateDataStoreEvents()
Collects all insertion, deletion and update events until
Database.flushDataStoreEvents() is called. |
void |
addDataStoreListener(DataStoreListener l)
Adds a listener for the
DataStoreEvent posted after the
content of the database changes. |
void |
flushDataStoreEvents()
Fires all collected insertion, deletion and update events as one
DataStoreEvent, i.e. notifies all registered DataStoreListener how the
content of the database has been changed since
Database.accumulateDataStoreEvents() has been called. |
SingleObjectBundle |
getBundle(DBIDRef id)
Returns the DatabaseObject represented by the specified id.
|
<O> DistanceQuery<O> |
getDistanceQuery(Relation<O> objQuery,
DistanceFunction<? super O> distanceFunction,
java.lang.Object... hints)
Get the distance query for a particular distance function.
|
<O> KNNQuery<O> |
getKNNQuery(DistanceQuery<O> distanceQuery,
java.lang.Object... hints)
Get a KNN query object for the given distance query.
|
protected abstract Logging |
getLogger()
Get the class logger.
|
java.lang.String |
getLongName()
A "pretty" name for the result, for use in titles, captions and menus.
|
<O> RangeQuery<O> |
getRangeQuery(DistanceQuery<O> distanceQuery,
java.lang.Object... hints)
Get a range query object for the given distance query for radius-based
neighbor search.
|
<O> Relation<O> |
getRelation(TypeInformation restriction,
java.lang.Object... hints)
Get an object representation.
|
java.util.Collection<Relation<?>> |
getRelations()
Get all relations of a database.
|
<O> RKNNQuery<O> |
getRKNNQuery(DistanceQuery<O> distanceQuery,
java.lang.Object... hints)
Get a rKNN query object for the given distance query.
|
java.lang.String |
getShortName()
A short name for the result, useful for file names.
|
<O> SimilarityQuery<O> |
getSimilarityQuery(Relation<O> objQuery,
SimilarityFunction<? super O> similarityFunction,
java.lang.Object... hints)
Get the similarity query for a particular similarity function.
|
<O> RangeQuery<O> |
getSimilarityRangeQuery(SimilarityQuery<O> simQuery,
java.lang.Object... hints)
Get a range query object for the given distance query for radius-based
neighbor search.
|
void |
removeDataStoreListener(DataStoreListener l)
Removes a listener previously added with
Database.addDataStoreListener(DataStoreListener) . |
addChildResult, getHierarchy, setHierarchy
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
initialize
getHierarchy, setHierarchy
protected final DatabaseEventManager eventManager
protected final java.util.List<Relation<?>> relations
protected final java.util.Collection<IndexFactory<?>> indexFactories
public SingleObjectBundle getBundle(DBIDRef id)
Database
public java.util.Collection<Relation<?>> getRelations()
Database
getRelations
in interface Database
public <O> Relation<O> getRelation(TypeInformation restriction, java.lang.Object... hints) throws NoSupportedDataTypeException
Database
getRelation
in interface Database
O
- Object typerestriction
- Type restrictionhints
- Optimizer hintsNoSupportedDataTypeException
public <O> DistanceQuery<O> getDistanceQuery(Relation<O> objQuery, DistanceFunction<? super O> distanceFunction, java.lang.Object... hints)
Database
getDistanceQuery
in interface Database
O
- Object typeobjQuery
- Relation useddistanceFunction
- Distance function to usehints
- Optimizer hintspublic <O> SimilarityQuery<O> getSimilarityQuery(Relation<O> objQuery, SimilarityFunction<? super O> similarityFunction, java.lang.Object... hints)
Database
getSimilarityQuery
in interface Database
O
- Object typeobjQuery
- Relation usedsimilarityFunction
- Similarity function to usehints
- Optimizer hintspublic <O> KNNQuery<O> getKNNQuery(DistanceQuery<O> distanceQuery, java.lang.Object... hints)
Database
DatabaseQuery.HINT_BULK
bulk query neededgetKNNQuery
in interface Database
O
- Object typedistanceQuery
- Distance queryhints
- Optimizer hintspublic <O> RangeQuery<O> getRangeQuery(DistanceQuery<O> distanceQuery, java.lang.Object... hints)
Database
DatabaseQuery.HINT_BULK
bulk query neededgetRangeQuery
in interface Database
O
- Object typedistanceQuery
- Distance queryhints
- Optimizer hintspublic <O> RangeQuery<O> getSimilarityRangeQuery(SimilarityQuery<O> simQuery, java.lang.Object... hints)
Database
DatabaseQuery.HINT_BULK
bulk query neededgetSimilarityRangeQuery
in interface Database
O
- Object typesimQuery
- Similarity queryhints
- Optimizer hintspublic <O> RKNNQuery<O> getRKNNQuery(DistanceQuery<O> distanceQuery, java.lang.Object... hints)
Database
DatabaseQuery.HINT_BULK
bulk query neededgetRKNNQuery
in interface Database
O
- Object typedistanceQuery
- Distance queryhints
- Optimizer hintspublic void addDataStoreListener(DataStoreListener l)
Database
DataStoreEvent
posted after the
content of the database changes.addDataStoreListener
in interface Database
l
- the listener to addDatabase.removeDataStoreListener(DataStoreListener)
,
DataStoreListener
,
DataStoreEvent
public void removeDataStoreListener(DataStoreListener l)
Database
Database.addDataStoreListener(DataStoreListener)
.removeDataStoreListener
in interface Database
l
- the listener to removeDatabase.addDataStoreListener(DataStoreListener)
,
DataStoreListener
,
DataStoreEvent
public void accumulateDataStoreEvents()
Database
Database.flushDataStoreEvents()
is called.accumulateDataStoreEvents
in interface Database
DataStoreEvent
public void flushDataStoreEvents()
Database
Database.accumulateDataStoreEvents()
has been called.flushDataStoreEvents
in interface Database
DataStoreListener
,
DataStoreEvent
public java.lang.String getLongName()
Result
getLongName
in interface Result
public java.lang.String getShortName()
Result
getShortName
in interface Result
protected abstract Logging getLogger()
Copyright © 2019 ELKI Development Team. License information.