de.lmu.ifi.dbs.elki.database.query.distance
Class DBIDDistanceQuery<D extends Distance<D>>

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.database.query.AbstractDataBasedQuery<O>
      extended by de.lmu.ifi.dbs.elki.database.query.distance.AbstractDistanceQuery<O,D>
          extended by de.lmu.ifi.dbs.elki.database.query.distance.AbstractDatabaseDistanceQuery<DBID,D>
              extended by de.lmu.ifi.dbs.elki.database.query.distance.DBIDDistanceQuery<D>
Type Parameters:
D - Distance result type.
All Implemented Interfaces:
DatabaseQuery, DistanceQuery<DBID,D>

public class DBIDDistanceQuery<D extends Distance<D>>
extends AbstractDatabaseDistanceQuery<DBID,D>

Run a distance query based on DBIDs


Field Summary
protected  DBIDDistanceFunction<D> distanceFunction
          The distance function we use.
 
Fields inherited from class de.lmu.ifi.dbs.elki.database.query.AbstractDataBasedQuery
relation
 
Fields inherited from interface de.lmu.ifi.dbs.elki.database.query.DatabaseQuery
HINT_BULK, HINT_EXACT, HINT_HEAVY_USE, HINT_NO_CACHE, HINT_OPTIMIZED_ONLY, HINT_SINGLE
 
Constructor Summary
DBIDDistanceQuery(Relation<DBID> relation, DBIDDistanceFunction<D> distanceFunction)
          Constructor.
 
Method Summary
 D distance(DBID id1, DBID id2)
          Returns the distance between the two objects specified by their object ids.
 DBIDDistanceFunction<D> getDistanceFunction()
          Get the inner distance function.
 
Methods inherited from class de.lmu.ifi.dbs.elki.database.query.distance.AbstractDistanceQuery
getDistanceFactory, infiniteDistance, nullDistance, undefinedDistance
 
Methods inherited from class de.lmu.ifi.dbs.elki.database.query.AbstractDataBasedQuery
getRelation
 
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.query.distance.DistanceQuery
getRelation
 

Field Detail

distanceFunction

protected final DBIDDistanceFunction<D extends Distance<D>> distanceFunction
The distance function we use.

Constructor Detail

DBIDDistanceQuery

public DBIDDistanceQuery(Relation<DBID> relation,
                         DBIDDistanceFunction<D> distanceFunction)
Constructor.

Parameters:
relation - Database to use.
distanceFunction - Our distance function
Method Detail

distance

public D distance(DBID id1,
                  DBID id2)
Description copied from class: AbstractDistanceQuery
Returns the distance between the two objects specified by their object ids.

Specified by:
distance in interface DistanceQuery<DBID,D extends Distance<D>>
Overrides:
distance in class AbstractDatabaseDistanceQuery<DBID,D extends Distance<D>>
Parameters:
id1 - first object
id2 - second object
Returns:
the distance between the two objects specified by their object ids

getDistanceFunction

public DBIDDistanceFunction<D> getDistanceFunction()
Description copied from interface: DistanceQuery
Get the inner distance function.

Returns:
Distance function

Release 0.4.0 (2011-09-20_1324)