de.lmu.ifi.dbs.elki.distance.distancefunction
Class ProxyDistanceFunction<O,D extends Distance<D>>

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.distance.distancefunction.AbstractDBIDDistanceFunction<D>
      extended by de.lmu.ifi.dbs.elki.distance.distancefunction.ProxyDistanceFunction<O,D>
Type Parameters:
O - object type
D - distance type
All Implemented Interfaces:
DBIDDistanceFunction<D>, DistanceFunction<DBID,D>, InspectionUtilFrequentlyScanned, Parameterizable

public class ProxyDistanceFunction<O,D extends Distance<D>>
extends AbstractDBIDDistanceFunction<D>

Distance function to proxy computations to another distance (that probably was run before).


Field Summary
(package private)  DistanceQuery<O,D> inner
          Distance query
 
Constructor Summary
ProxyDistanceFunction(DistanceQuery<O,D> inner)
          Constructor
 
Method Summary
 D distance(DBID o1, DBID o2)
          Returns the distance between the two objects specified by their object ids.
 boolean equals(Object obj)
           
 D getDistanceFactory()
          Method to get the distance functions factory.
 DistanceQuery<O,D> getDistanceQuery()
          Get the inner query
 int hashCode()
           
static
<O,D extends Distance<D>>
ProxyDistanceFunction<O,D>
proxy(DistanceQuery<O,D> inner)
          Static method version.
 void setDistanceQuery(DistanceQuery<O,D> inner)
           
static
<V,T extends V,D extends Distance<D>>
DistanceFunction<? super V,D>
unwrapDistance(DistanceFunction<V,D> dfun)
          Helper function, to resolve any wrapped Proxy Distances
 
Methods inherited from class de.lmu.ifi.dbs.elki.distance.distancefunction.AbstractDBIDDistanceFunction
getInputTypeRestriction, instantiate, isMetric, isSymmetric
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

inner

DistanceQuery<O,D extends Distance<D>> inner
Distance query

Constructor Detail

ProxyDistanceFunction

public ProxyDistanceFunction(DistanceQuery<O,D> inner)
Constructor

Parameters:
inner - Inner distance
Method Detail

proxy

public static <O,D extends Distance<D>> ProxyDistanceFunction<O,D> proxy(DistanceQuery<O,D> inner)
Static method version.

Type Parameters:
O - Object type
D - Distance type
Parameters:
inner - Inner distance query
Returns:
Proxy object

distance

public D distance(DBID o1,
                  DBID o2)
Description copied from interface: DBIDDistanceFunction
Returns the distance between the two objects specified by their object ids.

Specified by:
distance in interface DBIDDistanceFunction<D extends Distance<D>>
Specified by:
distance in class AbstractDBIDDistanceFunction<D extends Distance<D>>
Parameters:
o1 - first object id
o2 - second object id
Returns:
the distance between the two objects specified by their object ids

getDistanceFactory

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

Specified by:
getDistanceFactory in interface DistanceFunction<DBID,D extends Distance<D>>
Specified by:
getDistanceFactory in class AbstractDBIDDistanceFunction<D extends Distance<D>>
Returns:
Factory for distance objects

getDistanceQuery

public DistanceQuery<O,D> getDistanceQuery()
Get the inner query

Returns:
query

setDistanceQuery

public void setDistanceQuery(DistanceQuery<O,D> inner)
Parameters:
inner - the inner distance query to set

unwrapDistance

public static <V,T extends V,D extends Distance<D>> DistanceFunction<? super V,D> unwrapDistance(DistanceFunction<V,D> dfun)
Helper function, to resolve any wrapped Proxy Distances

Type Parameters:
V - Object type
D - Distance type
Parameters:
dfun - Distance function to unwrap.
Returns:
unwrapped distance function

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

Release 0.4.0 (2011-09-20_1324)