|
|
|||||||||||||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.lmu.ifi.dbs.elki.logging.AbstractLoggable
de.lmu.ifi.dbs.elki.utilities.optionhandling.AbstractParameterizable
de.lmu.ifi.dbs.elki.preprocessing.PreprocessorHandler<O,P>
O
- the type of DatabaseObject to run the Preprocessor onP
- the type of Preprocessor usedpublic class PreprocessorHandler<O extends DatabaseObject,P extends Preprocessor<O>>
Handler class for all objects (e.g. distance functions) using a preprocessor running on a certain database.
Field Summary | |
---|---|
private AssociationID<?> |
associationID
The association ID for the association to be set by the preprocessor. |
private Database<O> |
database
The database to run the preprocessor on. |
private boolean |
omit
Holds the value of OMIT_PREPROCESSING_FLAG . |
private Flag |
OMIT_PREPROCESSING_FLAG
Flag to omit (a new) preprocessing if for each object the association has already been set. |
static OptionID |
OMIT_PREPROCESSING_ID
OptionID for OMIT_PREPROCESSING_FLAG |
private P |
preprocessor
Holds the instance of the preprocessor specified by PREPROCESSOR_PARAM . |
static OptionID |
PREPROCESSOR_ID
OptionID for PREPROCESSOR_PARAM |
private ClassParameter<P> |
PREPROCESSOR_PARAM
Parameter to specify the preprocessor to be used, must extend at least Preprocessor . |
private boolean |
time
Indicates if the time flag is set for preprocessing. |
private boolean |
verbose
Indicates if the verbose flag is set for preprocessing. |
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 | |
---|---|
PreprocessorHandler(PreprocessorClient<P,O> preprocessorClient)
Provides a handler class for all objects using a preprocessor, adding parameter PREPROCESSOR_PARAM and flag
OMIT_PREPROCESSING_FLAG to the option handler additionally to
parameters of super class. |
Method Summary | |
---|---|
P |
getPreprocessor()
Returns the preprocessor. |
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. |
List<String> |
setParameters(List<String> args)
Calls AbstractParameterizable#setParameters and sets additionally the
value of flag OMIT_PREPROCESSING_FLAG and instantiates
preprocessor according to the value of parameter
PREPROCESSOR_PARAM The remaining parameters are passed to the
preprocessor . |
Methods inherited from class de.lmu.ifi.dbs.elki.utilities.optionhandling.AbstractParameterizable |
---|
addOption, addParameterizable, addParameterizable, checkGlobalParameterConstraints, collectOptions, getAttributeSettings, getParameters, rememberParametersExcept, removeOption, removeParameterizable, shortDescription |
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 |
Field Detail |
---|
public static final OptionID PREPROCESSOR_ID
PREPROCESSOR_PARAM
private final ClassParameter<P extends Preprocessor<O>> PREPROCESSOR_PARAM
Preprocessor
.
Key: -distancefunction.preprocessor
private P extends Preprocessor<O> preprocessor
PREPROCESSOR_PARAM
.
public static final OptionID OMIT_PREPROCESSING_ID
OMIT_PREPROCESSING_FLAG
private final Flag OMIT_PREPROCESSING_FLAG
Key: -distancefunction.omitPreprocessing
private boolean omit
OMIT_PREPROCESSING_FLAG
.
private AssociationID<?> associationID
private boolean verbose
private boolean time
private Database<O extends DatabaseObject> database
Constructor Detail |
---|
public PreprocessorHandler(PreprocessorClient<P,O> preprocessorClient)
PREPROCESSOR_PARAM
and flag
OMIT_PREPROCESSING_FLAG
to the option handler additionally to
parameters of super class.
preprocessorClient
- the class using this handlerMethod Detail |
---|
public List<String> setParameters(List<String> args) throws ParameterException
AbstractParameterizable#setParameters
and sets additionally the
value of flag OMIT_PREPROCESSING_FLAG
and instantiates
preprocessor
according to the value of parameter
PREPROCESSOR_PARAM
The remaining parameters are passed to the
preprocessor
.
setParameters
in interface Parameterizable
setParameters
in class AbstractParameterizable
args
- parameters to set the attributes accordingly to
ParameterException
- in case of wrong parameter-settingpublic void objectsChanged(DatabaseEvent e)
OMIT_PREPROCESSING_FLAG
is not set.
objectsChanged
in interface DatabaseListener
e
- unusedpublic void objectsInserted(DatabaseEvent e)
OMIT_PREPROCESSING_FLAG
is not set.
objectsInserted
in interface DatabaseListener
e
- unusedpublic void objectsRemoved(DatabaseEvent e)
OMIT_PREPROCESSING_FLAG
is not set.
objectsRemoved
in interface DatabaseListener
e
- unusedpublic P getPreprocessor()
PREPROCESSOR_PARAM
public void runPreprocessor(Database<O> database, boolean verbose, boolean time)
database
- the database to run the preprocessor onverbose
- flag to allow verbose messages while performing the methodtime
- flag to request output of performance time
|
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |