|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.lmu.ifi.dbs.elki.result.AbstractHierarchicalResult de.lmu.ifi.dbs.elki.database.AbstractDatabase
public abstract class AbstractDatabase
Abstract base class for database API implementations. Provides default management of relations, indexes and events as well as default query matching.
Field Summary | |
---|---|
protected DatabaseEventManager |
eventManager
The event manager, collects events and fires them on demand. |
static OptionID |
INDEX_ID
Parameter to specify the indexes to use. |
protected List<Index> |
indexes
Indexes |
protected Collection<IndexFactory<?,?>> |
indexFactories
Index factories |
protected List<Relation<?>> |
relations
The relations we manage. |
Constructor Summary | |
---|---|
AbstractDatabase()
Constructor. |
Method Summary | ||
---|---|---|
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 |
addIndex(Index index)
Add a new index to the database. |
|
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(DBID id)
Returns the DatabaseObject represented by the specified id. |
|
|
getDistanceQuery(Relation<O> objQuery,
DistanceFunction<? super O,D> distanceFunction,
Object... hints)
Get the distance query for a particular distance function. |
|
Collection<Index> |
getIndexes()
Collection of known indexes |
|
|
getKNNQuery(DistanceQuery<O,D> distanceQuery,
Object... hints)
Get a KNN query object for the given distance query. |
|
protected abstract Logging |
getLogger()
|
|
String |
getLongName()
A "pretty" name for the result, for use in titles, captions and menus. |
|
|
getRangeQuery(DistanceQuery<O,D> distanceQuery,
Object... hints)
Get a range query object for the given distance query. |
|
|
getRelation(TypeInformation restriction,
Object... hints)
Get an object representation. |
|
Collection<Relation<?>> |
getRelations()
Get all relations of a database. |
|
|
getRKNNQuery(DistanceQuery<O,D> 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. |
|
|
getSimilarityQuery(Relation<O> objQuery,
SimilarityFunction<? super O,D> 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) . |
|
void |
removeIndex(Index index)
Remove a particular index |
Methods inherited from class de.lmu.ifi.dbs.elki.result.AbstractHierarchicalResult |
---|
addChildResult, getHierarchy, setHierarchy |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface de.lmu.ifi.dbs.elki.database.Database |
---|
getDBIDs, initialize, size |
Methods inherited from interface de.lmu.ifi.dbs.elki.result.HierarchicalResult |
---|
getHierarchy, setHierarchy |
Field Detail |
---|
public static final OptionID INDEX_ID
Key: -db.index
protected final DatabaseEventManager eventManager
protected final List<Relation<?>> relations
protected final List<Index> indexes
protected final Collection<IndexFactory<?,?>> indexFactories
Constructor Detail |
---|
public AbstractDatabase()
Method Detail |
---|
public void addIndex(Index index)
Database
addIndex
in interface Database
index
- Index to addpublic Collection<Index> getIndexes()
Database
getIndexes
in interface Database
public void removeIndex(Index index)
Database
removeIndex
in interface Database
index
- Index to removepublic SingleObjectBundle getBundle(DBID id)
Database
getBundle
in interface Database
id
- the id of the Object to be obtained from the 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 hints
NoSupportedDataTypeException
public <O,D extends Distance<D>> DistanceQuery<O,D> getDistanceQuery(Relation<O> objQuery, DistanceFunction<? super O,D> distanceFunction, Object... hints)
Database
getDistanceQuery
in interface Database
O
- Object typeD
- Distance result typeobjQuery
- Relation useddistanceFunction
- Distance function to usehints
- Optimizer hints
public <O,D extends Distance<D>> SimilarityQuery<O,D> getSimilarityQuery(Relation<O> objQuery, SimilarityFunction<? super O,D> similarityFunction, Object... hints)
Database
getSimilarityQuery
in interface Database
O
- Object typeD
- Similarity result typeobjQuery
- Relation usedsimilarityFunction
- Similarity function to usehints
- Optimizer hints
public <O,D extends Distance<D>> KNNQuery<O,D> getKNNQuery(DistanceQuery<O,D> distanceQuery, Object... hints)
Database
DatabaseQuery.HINT_BULK
bulk
query needed
getKNNQuery
in interface Database
O
- Object typeD
- Distance typedistanceQuery
- Distance queryhints
- Optimizer hints
public <O,D extends Distance<D>> RangeQuery<O,D> getRangeQuery(DistanceQuery<O,D> distanceQuery, Object... hints)
Database
DatabaseQuery.HINT_BULK
bulk
query needed
getRangeQuery
in interface Database
O
- Object typeD
- Distance typedistanceQuery
- Distance queryhints
- Optimizer hints
public <O,D extends Distance<D>> RKNNQuery<O,D> getRKNNQuery(DistanceQuery<O,D> distanceQuery, Object... hints)
Database
DatabaseQuery.HINT_BULK
bulk
query needed
getRKNNQuery
in interface Database
O
- Object typeD
- Distance typedistanceQuery
- Distance queryhints
- Optimizer hints
public 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()
|
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |