Environment for
DeveLoping
KDD-Applications
Supported by Index-Structures

de.lmu.ifi.dbs.elki.distance
Class AbstractMeasurementFunction<O extends DatabaseObject,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>
Type Parameters:
D - the type of Distance used as measurement for comparing database objects
O - the type of DatabaseObject for which a measurement is provided for comparison
All Implemented Interfaces:
MeasurementFunction<O,D>, Parameterizable
Direct Known Subclasses:
AbstractDistanceFunction, AbstractSimilarityFunction

public abstract class AbstractMeasurementFunction<O extends DatabaseObject,D extends Distance<D>>
extends AbstractParameterizable
implements MeasurementFunction<O,D>

Abstract implementation of interface MeasurementFunction that provides some methods valid for any extending class.

Author:
Elke Achtert

Field Summary
private  Database<O> database
          The database that holds the objects for which the measurements should be computed.
static String INFINITY_PATTERN
          Indicates an infinity pattern.
private  Pattern pattern
          A pattern to define the required input format.
 
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
protected AbstractMeasurementFunction()
          Provides an abstract MeasurementFunction.
protected AbstractMeasurementFunction(Pattern pattern)
          Provides an abstract MeasurementFunction based on the given pattern.
 
Method Summary
protected  Database<O> getDatabase()
          Returns the database holding the objects for which the measurements should be computed.
protected  boolean matches(String pattern)
          Returns true if the given pattern matches the pattern defined, false otherwise.
 String requiredInputPattern()
          Returns a String as description of the required input format.
 void setDatabase(Database<O> database, boolean verbose, boolean time)
          Set the database that holds the associations for the DatabaseObject for which the measurements should be computed.
protected  void setRequiredInputPattern(Pattern pattern)
          Sets the required input pattern.
 String shortDescription()
          Returns the required input pattern.
 
Methods inherited from class de.lmu.ifi.dbs.elki.utilities.optionhandling.AbstractParameterizable
addOption, addParameterizable, addParameterizable, checkGlobalParameterConstraints, collectOptions, getAttributeSettings, getParameters, rememberParametersExcept, removeOption, removeParameterizable, setParameters
 
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, undefinedDistance, valueOf
 
Methods inherited from interface de.lmu.ifi.dbs.elki.utilities.optionhandling.Parameterizable
checkGlobalParameterConstraints, collectOptions, getParameters, setParameters
 

Field Detail

INFINITY_PATTERN

public static final String INFINITY_PATTERN
Indicates an infinity pattern.

See Also:
Constant Field Values

pattern

private Pattern pattern
A pattern to define the required input format.


database

private Database<O extends DatabaseObject> database
The database that holds the objects for which the measurements should be computed.

Constructor Detail

AbstractMeasurementFunction

protected AbstractMeasurementFunction(Pattern pattern)
Provides an abstract MeasurementFunction based on the given pattern.

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

AbstractMeasurementFunction

protected AbstractMeasurementFunction()
Provides an abstract MeasurementFunction. This constructor can be used if the required input pattern is not yet known at instantiation time and will therefore be set later.

Method Detail

requiredInputPattern

public final String requiredInputPattern()
Description copied from interface: MeasurementFunction
Returns a String as description of the required input format.

Specified by:
requiredInputPattern in interface MeasurementFunction<O extends DatabaseObject,D extends Distance<D>>
Returns:
a String as description of the required input format

setDatabase

public void setDatabase(Database<O> database,
                        boolean verbose,
                        boolean time)
Description copied from interface: MeasurementFunction
Set the database that holds the associations for the DatabaseObject for which the measurements should be computed.

Specified by:
setDatabase in interface MeasurementFunction<O extends DatabaseObject,D extends Distance<D>>
Parameters:
database - Database
verbose - unused
time - unused

getDatabase

protected Database<O> getDatabase()
Returns the database holding the objects for which the measurements should be computed.

Returns:
the database holding the objects for which the measurements should be computed

matches

protected final boolean matches(String pattern)
Returns true if the given pattern matches the pattern defined, false otherwise.

Parameters:
pattern - the pattern to be matched with the pattern defined
Returns:
true if the given pattern matches the defined pattern, false otherwise

setRequiredInputPattern

protected final void setRequiredInputPattern(Pattern pattern)
Sets the required input pattern.

Parameters:
pattern - the pattern to be set

shortDescription

public String shortDescription()
Returns the required input pattern.

Specified by:
shortDescription in interface Parameterizable
Overrides:
shortDescription in class AbstractParameterizable
Returns:
Description of the class

Release 0.2 (2009-07-06_1820)