public abstract class AbstractDatabase extends AbstractHierarchicalResult implements Database
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 Collection<IndexFactory<?,?>> |
indexFactories
Index factories.
|
protected 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,
Object... hints)
Get the distance query for a particular distance function.
|
<O> KNNQuery<O> |
getKNNQuery(DistanceQuery<O> distanceQuery,
Object... hints)
Get a KNN query object for the given distance query.
|
protected abstract Logging |
getLogger()
Get the class logger.
|
String |
getLongName()
A "pretty" name for the result, for use in titles, captions and menus.
|
<O> RangeQuery<O> |
getRangeQuery(DistanceQuery<O> distanceQuery,
Object... hints)
Get a range query object for the given distance query for radius-based
neighbor search.
|
<O> Relation<O> |
getRelation(TypeInformation restriction,
Object... hints)
Get an object representation.
|
Collection<Relation<?>> |
getRelations()
Get all relations of a database.
|
<O> RKNNQuery<O> |
getRKNNQuery(DistanceQuery<O> distanceQuery,
Object... hints)
Get a rKNN query object for the given distance query.
|
String |
getShortName()
A short name for the result, useful for file names.
|
<O> SimilarityQuery<O> |
getSimilarityQuery(Relation<O> objQuery,
SimilarityFunction<? super O> similarityFunction,
Object... hints)
Get the similarity query for a particular similarity function.
|
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 Collection<IndexFactory<?,?>> indexFactories
public SingleObjectBundle getBundle(DBIDRef id)
Database
public Collection<Relation<?>> getRelations()
Database
getRelations
in interface Database
public <O> Relation<O> getRelation(TypeInformation restriction, 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, 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, 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, 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, Object... hints)
Database
DatabaseQuery.HINT_BULK
bulk
query neededgetRangeQuery
in interface Database
O
- Object typedistanceQuery
- Distance queryhints
- Optimizer hintspublic <O> RKNNQuery<O> getRKNNQuery(DistanceQuery<O> distanceQuery, 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 String getLongName()
Result
getLongName
in interface Result
public String getShortName()
Result
getShortName
in interface Result
protected abstract Logging getLogger()
Copyright © 2015 ELKI Development Team, Lehr- und Forschungseinheit für Datenbanksysteme, Ludwig-Maximilians-Universität München. License information.