Environment for
DeveLoping
KDD-Applications
Supported by Index-Structures

de.lmu.ifi.dbs.elki.distance.similarityfunction
Class AbstractPreprocessorBasedSimilarityFunction<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.similarityfunction.AbstractSimilarityFunction<O,D>
                  extended by de.lmu.ifi.dbs.elki.distance.similarityfunction.AbstractPreprocessorBasedSimilarityFunction<O,P,D>
Type Parameters:
O - object type
P - preprocessor type
D - distance type
All Implemented Interfaces:
MeasurementFunction<O,D>, PreprocessorBasedMeasurementFunction<O,P,D>, SimilarityFunction<O,D>, PreprocessorClient<P,O>, Parameterizable
Direct Known Subclasses:
FractionalSharedNearestNeighborSimilarityFunction, SharedNearestNeighborSimilarityFunction

public abstract class AbstractPreprocessorBasedSimilarityFunction<O extends DatabaseObject,P extends Preprocessor<O>,D extends Distance<D>>
extends AbstractSimilarityFunction<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
AbstractPreprocessorBasedSimilarityFunction(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 the super method and passes the remaining parameters to the preprocessorHandler.
 
Methods inherited from class de.lmu.ifi.dbs.elki.distance.similarityfunction.AbstractSimilarityFunction
similarity, similarity
 
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.similarityfunction.SimilarityFunction
similarity
 

Field Detail

preprocessorHandler

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

Constructor Detail

AbstractPreprocessorBasedSimilarityFunction

public AbstractPreprocessorBasedSimilarityFunction(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 the super method 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
See Also:
PreprocessorHandler.getPreprocessor()

Release 0.2 (2009-07-06_1820)