Package elki.database.query.distance
Class DBIDDistanceQuery
- java.lang.Object
-
- elki.database.query.distance.DBIDDistanceQuery
-
- All Implemented Interfaces:
DatabaseDistanceQuery<DBID>,DistanceQuery<DBID>
- Direct Known Subclasses:
DBIDRangeDistanceQuery
public class DBIDDistanceQuery extends java.lang.Object implements DatabaseDistanceQuery<DBID>
Run a distance query based on DBIDs- Since:
- 0.4.0
- Author:
- Erich Schubert
-
-
Field Summary
Fields Modifier and Type Field Description protected DBIDDistancedistanceFunctionThe distance function we use.protected Relation<DBID>relationRelation to query.
-
Constructor Summary
Constructors Constructor Description DBIDDistanceQuery(Relation<DBID> relation, DBIDDistance distanceFunction)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description doubledistance(DBIDRef id1, DBIDRef id2)Returns the distance between the two objects specified by their object ids.DBIDDistancegetDistance()Get the inner distance function.Relation<? extends DBID>getRelation()Access the underlying data query.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface elki.database.query.distance.DatabaseDistanceQuery
distance, distance, distance
-
-
-
-
Field Detail
-
distanceFunction
protected final DBIDDistance distanceFunction
The distance function we use.
-
-
Constructor Detail
-
DBIDDistanceQuery
public DBIDDistanceQuery(Relation<DBID> relation, DBIDDistance distanceFunction)
Constructor.- Parameters:
relation- Database to use.distanceFunction- Our distance function
-
-
Method Detail
-
distance
public double distance(DBIDRef id1, DBIDRef id2)
Description copied from interface:DistanceQueryReturns the distance between the two objects specified by their object ids.- Specified by:
distancein interfaceDistanceQuery<DBID>- Parameters:
id1- first object idid2- second object id- Returns:
- the distance between the two objects specified by their object ids
-
getRelation
public Relation<? extends DBID> getRelation()
Description copied from interface:DistanceQueryAccess the underlying data query.- Specified by:
getRelationin interfaceDistanceQuery<DBID>- Returns:
- data query in use
-
getDistance
public DBIDDistance getDistance()
Description copied from interface:DistanceQueryGet the inner distance function.- Specified by:
getDistancein interfaceDistanceQuery<DBID>- Returns:
- Distance function
-
-