Environment for
DeveLoping
KDD-Applications
Supported by Index-Structures

de.lmu.ifi.dbs.elki.preprocessing
Class PreprocessorHandler<O extends DatabaseObject,P extends Preprocessor<O>>

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.preprocessing.PreprocessorHandler<O,P>
All Implemented Interfaces:
DatabaseListener

public class PreprocessorHandler<O extends DatabaseObject,P extends Preprocessor<O>>
extends Object
implements DatabaseListener

Handler class for all distance function using a preprocessor.

Author:
Elke Achtert

Field Summary
private  AssociationID associationID
          The assocoiation ID for the association to be set by the preprocessor
private  Database<O> database
          The database to run the preprocessor on.
private  boolean omit
          True, if preprocessing is omitted, false otherwise.
static String OMIT_PREPROCESSING_D
          Description for flag for force of preprocessing.
static String OMIT_PREPROCESSING_F
          Flag for omission of preprocessing.
static Flag OMIT_PREPROCESSING_FLAG
           
private  P preprocessor
          The preprocessor to run the variance analysis of the objects.
static String PREPROCESSOR_CLASS_P
          Parameter for preprocessor.
private  String preprocessorClassDescription
          The description for the preprocessor class.
private  Class<? extends Preprocessor> preprocessorSuperClassName
          The super class for the preprocessor class.
private  boolean time
          Indicates if the time flag is set for preprocessing.
private  boolean verbose
          Indicates if the verbose flag is set for preprocessing..
 
Constructor Summary
PreprocessorHandler(OptionHandler optionHandler, String preprocessorClassDescription, Class<P> preprocessorSuperClassName, String defaultPreprocessorClassName, AssociationID associationID)
          Provides a handler class for all distance function using a preprocessor.
 
Method Summary
 void addAttributeSettings(List<AttributeSettings> settingsList)
          Adds the parameter settings of the preprocessor to the specified list.
 P getPreprocessor()
          Returns the preprocessor of this distance function.
 void objectsChanged(DatabaseEvent e)
          Invoked after objects of the database have been updated in some way.
 void objectsInserted(DatabaseEvent e)
          Invoked after an object has been inserted into the database.
 void objectsRemoved(DatabaseEvent e)
          Invoked after an object has been deleted from the database.
 void runPreprocessor(Database<O> database, boolean verbose, boolean time)
          Runs the preprocessor on the database if the omit flag is not set or the database does contain the association id neither for any id nor as global association.
 String[] setParameters(OptionHandler optionHandler, String[] parameters)
          Sets the values for the parameters delta and preprocessor if specified.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PREPROCESSOR_CLASS_P

public static final String PREPROCESSOR_CLASS_P
Parameter for preprocessor.

See Also:
Constant Field Values

OMIT_PREPROCESSING_F

public static final String OMIT_PREPROCESSING_F
Flag for omission of preprocessing.

See Also:
Constant Field Values

OMIT_PREPROCESSING_D

public static final String OMIT_PREPROCESSING_D
Description for flag for force of preprocessing. TODO: description: matrix?

See Also:
Constant Field Values

OMIT_PREPROCESSING_FLAG

public static final Flag OMIT_PREPROCESSING_FLAG

omit

private boolean omit
True, if preprocessing is omitted, false otherwise.


preprocessor

private P extends Preprocessor<O> preprocessor
The preprocessor to run the variance analysis of the objects.


associationID

private AssociationID associationID
The assocoiation ID for the association to be set by the preprocessor


preprocessorSuperClassName

private Class<? extends Preprocessor> preprocessorSuperClassName
The super class for the preprocessor class.


preprocessorClassDescription

private String preprocessorClassDescription
The description for the preprocessor class.


verbose

private boolean verbose
Indicates if the verbose flag is set for preprocessing..


time

private boolean time
Indicates if the time flag is set for preprocessing.


database

private Database<O extends DatabaseObject> database
The database to run the preprocessor on.

Constructor Detail

PreprocessorHandler

public PreprocessorHandler(OptionHandler optionHandler,
                           String preprocessorClassDescription,
                           Class<P> preprocessorSuperClassName,
                           String defaultPreprocessorClassName,
                           AssociationID associationID)
Provides a handler class for all distance function using a preprocessor.

Parameters:
optionHandler - the option handler for parameter handling.
preprocessorClassDescription - the description for the preprocessor class
preprocessorSuperClassName - the super class for the preprocessor class
defaultPreprocessorClassName - the class name for the default preprocessor class
associationID - the assocoiation ID for the association to be set by the preprocessor
Method Detail

setParameters

public String[] setParameters(OptionHandler optionHandler,
                              String[] parameters)
                       throws ParameterException
Sets the values for the parameters delta and preprocessor if specified. If the parameters are not specified default values are set.

Throws:
ParameterException
See Also:
Parameterizable.setParameters(String[])

addAttributeSettings

public void addAttributeSettings(List<AttributeSettings> settingsList)
Adds the parameter settings of the preprocessor to the specified list.

Parameters:
settingsList - the list of parameter settings to add the parameter settings of the preprocessor to

objectsChanged

public void objectsChanged(DatabaseEvent e)
Invoked after objects of the database have been updated in some way. Use e.getObjects() to get the updated database objects.

Specified by:
objectsChanged in interface DatabaseListener
Parameters:
e - the update event

objectsInserted

public void objectsInserted(DatabaseEvent e)
Invoked after an object has been inserted into the database. Use e.getObjects() to get the newly inserted database objects.

Specified by:
objectsInserted in interface DatabaseListener
Parameters:
e - the insertion event

objectsRemoved

public void objectsRemoved(DatabaseEvent e)
Invoked after an object has been deleted from the database. Use e.getObjects() to get the inserted database objects.

Specified by:
objectsRemoved in interface DatabaseListener
Parameters:
e - the removal event

getPreprocessor

public P getPreprocessor()
Returns the preprocessor of this distance function.

Returns:
the preprocessor of this distance function

runPreprocessor

public void runPreprocessor(Database<O> database,
                            boolean verbose,
                            boolean time)
Runs the preprocessor on the database if the omit flag is not set or the database does contain the association id neither for any id nor as global association.

Parameters:
database - the database to run the preprocessor on
verbose - flag to allow verbose messages while performing the method
time - flag to request output of performance time

Release 0.1 (2008-07-10_1838)