Environment for
DeveLoping
KDD-Applications
Supported by Index-Structures

de.lmu.ifi.dbs.elki.distance.distancefunction
Class AbstractPreprocessorBasedDistanceFunction<O extends DatabaseObject,P extends Preprocessor<O>,D extends Distance<D>>

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.logging.AbstractLoggable
      extended by de.lmu.ifi.dbs.elki.utilities.optionhandling.AbstractParameterizable
          extended by de.lmu.ifi.dbs.elki.distance.AbstractMeasurementFunction<O,D>
              extended by de.lmu.ifi.dbs.elki.distance.distancefunction.AbstractDistanceFunction<O,D>
                  extended by de.lmu.ifi.dbs.elki.distance.distancefunction.AbstractPreprocessorBasedDistanceFunction<O,P,D>
Type Parameters:
O - the type of DatabaseObject to compute the distances in between
P - the type of Preprocessor used
D - the type of Distance used
All Implemented Interfaces:
DistanceFunction<O,D>, MeasurementFunction<O,D>, PreprocessorBasedMeasurementFunction<O,P,D>, PreprocessorClient<P,O>, Parameterizable
Direct Known Subclasses:
AbstractCorrelationDistanceFunction, ERiCDistanceFunction, SubspaceDistanceFunction

public abstract class AbstractPreprocessorBasedDistanceFunction<O extends DatabaseObject,P extends Preprocessor<O>,D extends Distance<D>>
extends AbstractDistanceFunction<O,D>
implements PreprocessorBasedMeasurementFunction<O,P,D>

Abstract super class for distance functions needing a preprocessor.

Author:
Elke Achtert

Field Summary
private  PreprocessorHandler<O,P> preprocessorHandler
          The handler class for the preprocessor.
 
Fields inherited from class de.lmu.ifi.dbs.elki.distance.AbstractMeasurementFunction
INFINITY_PATTERN
 
Fields inherited from class de.lmu.ifi.dbs.elki.utilities.optionhandling.AbstractParameterizable
optionHandler
 
Fields inherited from class de.lmu.ifi.dbs.elki.logging.AbstractLoggable
debug, logger
 
Constructor Summary
AbstractPreprocessorBasedDistanceFunction(Pattern pattern)
          Provides a super class for distance functions needing a preprocessor
 
Method Summary
 P getPreprocessor()
          Returns the preprocessor of this measurement function.
 void setDatabase(Database<O> database, boolean verbose, boolean time)
          Calls AbstractMeasurementFunction(database, verbose, time) and runs the preprocessor on the database.
 List<String> setParameters(List<String> args)
          Calls AbstractParameterizable#setParameters and passes the remaining parameters to the preprocessorHandler.
 
Methods inherited from class de.lmu.ifi.dbs.elki.distance.distancefunction.AbstractDistanceFunction
distance, distance, isInfiniteDistance, isNullDistance, isUndefinedDistance
 
Methods inherited from class de.lmu.ifi.dbs.elki.distance.AbstractMeasurementFunction
getDatabase, matches, requiredInputPattern, setRequiredInputPattern, shortDescription
 
Methods inherited from class de.lmu.ifi.dbs.elki.utilities.optionhandling.AbstractParameterizable
addOption, addParameterizable, addParameterizable, checkGlobalParameterConstraints, collectOptions, getAttributeSettings, getParameters, rememberParametersExcept, removeOption, removeParameterizable
 
Methods inherited from class de.lmu.ifi.dbs.elki.logging.AbstractLoggable
debugFine, debugFiner, debugFinest, exception, progress, verbose, warning
 
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.distance.MeasurementFunction
infiniteDistance, isInfiniteDistance, isNullDistance, isUndefinedDistance, nullDistance, requiredInputPattern, undefinedDistance, valueOf
 
Methods inherited from interface de.lmu.ifi.dbs.elki.preprocessing.PreprocessorClient
getAssociationID, getDefaultPreprocessorClassName, getPreprocessorDescription, getPreprocessorSuperClass
 
Methods inherited from interface de.lmu.ifi.dbs.elki.utilities.optionhandling.Parameterizable
checkGlobalParameterConstraints, collectOptions, getParameters, shortDescription
 
Methods inherited from interface de.lmu.ifi.dbs.elki.distance.distancefunction.DistanceFunction
distance
 

Field Detail

preprocessorHandler

private final PreprocessorHandler<O extends DatabaseObject,P extends Preprocessor<O>> preprocessorHandler
The handler class for the preprocessor.

Constructor Detail

AbstractPreprocessorBasedDistanceFunction

public AbstractPreprocessorBasedDistanceFunction(Pattern pattern)
Provides a super class for distance functions needing a preprocessor

Parameters:
pattern - a pattern to define the required input format
Method Detail

setDatabase

public void setDatabase(Database<O> database,
                        boolean verbose,
                        boolean time)
Calls AbstractMeasurementFunction(database, verbose, time) and runs the preprocessor on the database.

Specified by:
setDatabase in interface MeasurementFunction<O extends DatabaseObject,D extends Distance<D>>
Overrides:
setDatabase in class AbstractMeasurementFunction<O extends DatabaseObject,D extends Distance<D>>
Parameters:
database - the database to be set
verbose - flag to allow verbose messages while performing the method
time - flag to request output of performance time

setParameters

public List<String> setParameters(List<String> args)
                           throws ParameterException
Calls AbstractParameterizable#setParameters and passes the remaining parameters to the preprocessorHandler.

Specified by:
setParameters in interface Parameterizable
Overrides:
setParameters in class AbstractParameterizable
Parameters:
args - parameters to set the attributes accordingly to
Returns:
a list containing the unused parameters
Throws:
ParameterException - in case of wrong parameter-setting

getPreprocessor

public final P getPreprocessor()
Description copied from interface: PreprocessorBasedMeasurementFunction
Returns the preprocessor of this measurement function.

Specified by:
getPreprocessor in interface PreprocessorBasedMeasurementFunction<O extends DatabaseObject,P extends Preprocessor<O>,D extends Distance<D>>
Returns:
the preprocessor of this measurement function

Release 0.2.1 (2009-07-13_1605)