de.lmu.ifi.dbs.elki.database
Class QueryUtil

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.database.QueryUtil

public final class QueryUtil
extends Object

Static class with utilities related to querying a database.


Constructor Summary
QueryUtil()
           
 
Method Summary
static
<O,D extends Distance<D>>
DistanceQuery<O,D>
getDistanceQuery(Database database, DistanceFunction<? super O,D> distanceFunction, Object... hints)
          Get a distance query for a given distance function, automatically choosing a relation.
static
<O,D extends Distance<D>>
KNNQuery<O,D>
getKNNQuery(Database database, DistanceFunction<? super O,D> distanceFunction, Object... hints)
          Get a KNN query object for the given distance function.
static
<O,D extends Distance<D>>
KNNQuery<O,D>
getKNNQuery(Relation<O> relation, DistanceFunction<? super O,D> distanceFunction, Object... hints)
          Get a KNN query object for the given distance function.
static
<O,D extends Distance<D>>
KNNQuery<O,D>
getLinearScanKNNQuery(DistanceQuery<O,D> distanceQuery)
          Get a linear scan query for the given distance query.
static
<O,D extends Distance<D>>
RangeQuery<O,D>
getLinearScanRangeQuery(DistanceQuery<O,D> distanceQuery)
          Get a linear scan query for the given distance query.
static
<O,D extends Distance<D>>
RangeQuery<O,D>
getRangeQuery(Database database, DistanceFunction<? super O,D> distanceFunction, Object... hints)
          Get a range query object for the given distance function.
static
<O,D extends Distance<D>>
RangeQuery<O,D>
getRangeQuery(Relation<O> relation, DistanceFunction<? super O,D> distanceFunction, Object... hints)
          Get a range query object for the given distance function.
static
<O,D extends Distance<D>>
RKNNQuery<O,D>
getRKNNQuery(Relation<O> relation, DistanceFunction<? super O,D> distanceFunction, Object... hints)
          Get a rKNN query object for the given distance function.
static
<O,D extends Distance<D>>
SimilarityQuery<O,D>
getSimilarityQuery(Database database, SimilarityFunction<? super O,D> similarityFunction, Object... hints)
          Get a similarity query, automatically choosing a relation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QueryUtil

public QueryUtil()
Method Detail

getDistanceQuery

public static <O,D extends Distance<D>> DistanceQuery<O,D> getDistanceQuery(Database database,
                                                                            DistanceFunction<? super O,D> distanceFunction,
                                                                            Object... hints)
Get a distance query for a given distance function, automatically choosing a relation.

Type Parameters:
O - Object type
D - Distance type
Parameters:
database - Database
distanceFunction - Distance function
hints - Optimizer hints
Returns:
Distance query

getSimilarityQuery

public static <O,D extends Distance<D>> SimilarityQuery<O,D> getSimilarityQuery(Database database,
                                                                                SimilarityFunction<? super O,D> similarityFunction,
                                                                                Object... hints)
Get a similarity query, automatically choosing a relation.

Type Parameters:
O - Object type
D - Distance type
Parameters:
database - Database
similarityFunction - Similarity function
hints - Optimizer hints
Returns:
Similarity Query

getKNNQuery

public static <O,D extends Distance<D>> KNNQuery<O,D> getKNNQuery(Database database,
                                                                  DistanceFunction<? super O,D> distanceFunction,
                                                                  Object... hints)
Get a KNN query object for the given distance function. When possible, this will use an index, but it may default to an expensive linear scan. Hints include:

Type Parameters:
O - Object type
D - Distance type
Parameters:
database - Database
distanceFunction - Distance function
hints - Optimizer hints
Returns:
KNN Query object

getKNNQuery

public static <O,D extends Distance<D>> KNNQuery<O,D> getKNNQuery(Relation<O> relation,
                                                                  DistanceFunction<? super O,D> distanceFunction,
                                                                  Object... hints)
Get a KNN query object for the given distance function. When possible, this will use an index, but it may default to an expensive linear scan. Hints include:

Type Parameters:
O - Object type
D - Distance type
Parameters:
relation - Relation used
distanceFunction - Distance function
hints - Optimizer hints
Returns:
KNN Query object

getRangeQuery

public static <O,D extends Distance<D>> RangeQuery<O,D> getRangeQuery(Database database,
                                                                      DistanceFunction<? super O,D> distanceFunction,
                                                                      Object... hints)
Get a range query object for the given distance function. When possible, this will use an index, but it may default to an expensive linear scan. Hints include:

Type Parameters:
O - Object type
D - Distance type
Parameters:
database - Database
distanceFunction - Distance function
hints - Optimizer hints
Returns:
KNN Query object

getRangeQuery

public static <O,D extends Distance<D>> RangeQuery<O,D> getRangeQuery(Relation<O> relation,
                                                                      DistanceFunction<? super O,D> distanceFunction,
                                                                      Object... hints)
Get a range query object for the given distance function. When possible, this will use an index, but it may default to an expensive linear scan. Hints include:

Type Parameters:
O - Object type
D - Distance type
Parameters:
relation - Relation used
distanceFunction - Distance function
hints - Optimizer hints
Returns:
KNN Query object

getRKNNQuery

public static <O,D extends Distance<D>> RKNNQuery<O,D> getRKNNQuery(Relation<O> relation,
                                                                    DistanceFunction<? super O,D> distanceFunction,
                                                                    Object... hints)
Get a rKNN query object for the given distance function. When possible, this will use an index, but it may default to an expensive linear scan. Hints include:

Type Parameters:
O - Object type
D - Distance type
Parameters:
relation - Relation used
distanceFunction - Distance function
hints - Optimizer hints
Returns:
RKNN Query object

getLinearScanKNNQuery

public static <O,D extends Distance<D>> KNNQuery<O,D> getLinearScanKNNQuery(DistanceQuery<O,D> distanceQuery)
Get a linear scan query for the given distance query.

Type Parameters:
O - Object type
D - Distance type
Parameters:
distanceQuery - distance query
Returns:
KNN query

getLinearScanRangeQuery

public static <O,D extends Distance<D>> RangeQuery<O,D> getLinearScanRangeQuery(DistanceQuery<O,D> distanceQuery)
Get a linear scan query for the given distance query.

Type Parameters:
O - Object type
D - Distance type
Parameters:
distanceQuery - distance query
Returns:
Range query

Release 0.4.0 (2011-09-20_1324)