de.lmu.ifi.dbs.elki.database.query.distance
Class AbstractDistanceQuery<O,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>
All Implemented Interfaces:
DatabaseQuery, DistanceQuery<O,D>
Direct Known Subclasses:
AbstractDatabaseDistanceQuery, PrimitiveDistanceQuery

public abstract class AbstractDistanceQuery<O,D extends Distance<D>>
extends AbstractDataBasedQuery<O>
implements DistanceQuery<O,D>

A distance query serves as adapter layer for database and primitive distances.


Field Summary
 
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
AbstractDistanceQuery(Relation<? extends O> relation)
          Constructor.
 
Method Summary
abstract  D distance(DBID id1, DBID id2)
          Returns the distance between the two objects specified by their object ids.
abstract  D distance(DBID id1, O o2)
          Returns the distance between the two objects specified by their object ids.
abstract  D distance(O o1, DBID id2)
          Returns the distance between the two objects specified by their object ids.
abstract  D distance(O o1, O o2)
          Returns the distance between the two objects specified by their object ids.
 D getDistanceFactory()
          Method to get the distance functions factory.
 D infiniteDistance()
          Provides an infinite distance.
 D nullDistance()
          Provides a null distance.
 D undefinedDistance()
          Provides an undefined distance.
 
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
getDistanceFunction, getRelation
 

Constructor Detail

AbstractDistanceQuery

public AbstractDistanceQuery(Relation<? extends O> relation)
Constructor.

Parameters:
relation - Relation to use.
Method Detail

distance

public abstract D distance(DBID id1,
                           DBID id2)
Returns the distance between the two objects specified by their object ids.

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

distance

public abstract D distance(O o1,
                           DBID id2)
Returns the distance between the two objects specified by their object ids.

Specified by:
distance in interface DistanceQuery<O,D extends Distance<D>>
Parameters:
o1 - first object
id2 - second object id
Returns:
the distance between the two objects specified by their object ids

distance

public abstract D distance(DBID id1,
                           O o2)
Returns the distance between the two objects specified by their object ids.

Specified by:
distance in interface DistanceQuery<O,D extends Distance<D>>
Parameters:
id1 - first object id
o2 - second object
Returns:
the distance between the two objects specified by their object ids

distance

public abstract D distance(O o1,
                           O o2)
Returns the distance between the two objects specified by their object ids.

Specified by:
distance in interface DistanceQuery<O,D extends Distance<D>>
Parameters:
o1 - first object
o2 - second object
Returns:
the distance between the two objects specified by their object ids

getDistanceFactory

public D getDistanceFactory()
Description copied from interface: DistanceQuery
Method to get the distance functions factory.

Specified by:
getDistanceFactory in interface DistanceQuery<O,D extends Distance<D>>
Returns:
Factory for distance objects

infiniteDistance

public D infiniteDistance()
Provides an infinite distance.

Specified by:
infiniteDistance in interface DistanceQuery<O,D extends Distance<D>>
Returns:
an infinite distance

nullDistance

public D nullDistance()
Provides a null distance.

Specified by:
nullDistance in interface DistanceQuery<O,D extends Distance<D>>
Returns:
a null distance

undefinedDistance

public D undefinedDistance()
Provides an undefined distance.

Specified by:
undefinedDistance in interface DistanceQuery<O,D extends Distance<D>>
Returns:
an undefined distance

Release 0.4.0 (2011-09-20_1324)