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 DBIDDistance
distanceFunction
The distance function we use.protected Relation<DBID>
relation
Relation 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 double
distance(DBIDRef id1, DBIDRef id2)
Returns the distance between the two objects specified by their object ids.DBIDDistance
getDistance()
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:DistanceQuery
Returns the distance between the two objects specified by their object ids.- Specified by:
distance
in 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:DistanceQuery
Access the underlying data query.- Specified by:
getRelation
in interfaceDistanceQuery<DBID>
- Returns:
- data query in use
-
getDistance
public DBIDDistance getDistance()
Description copied from interface:DistanceQuery
Get the inner distance function.- Specified by:
getDistance
in interfaceDistanceQuery<DBID>
- Returns:
- Distance function
-
-