de.lmu.ifi.dbs.elki.datasource.filter
Class AbstractConversionFilter<I,O>

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.datasource.filter.AbstractConversionFilter<I,O>
Type Parameters:
I - Input object type
O - Input object type
All Implemented Interfaces:
ObjectFilter
Direct Known Subclasses:
AbstractFeatureSelectionFilter, AbstractNormalization, AbstractRandomFeatureSelectionFilter

public abstract class AbstractConversionFilter<I,O>
extends Object
implements ObjectFilter

Abstract base class for simple conversion filters such as normalizations and projections.


Constructor Summary
AbstractConversionFilter()
           
 
Method Summary
protected abstract  SimpleTypeInformation<? super O> convertedType(SimpleTypeInformation<I> in)
          Get the output type from the input type after conversion.
 MultipleObjectsBundle filter(MultipleObjectsBundle objects)
          A standard implementation of the filter process.
protected abstract  O filterSingleObject(I obj)
          Normalize a single instance.
protected abstract  SimpleTypeInformation<? super I> getInputTypeRestriction()
          Get the input type restriction used for negotiating the data query.
protected  void prepareComplete()
          Complete the initialization phase
protected  void prepareProcessInstance(I obj)
          Process a single object during initialization.
protected  boolean prepareStart(SimpleTypeInformation<I> in)
          Return "true" when the normalization needs initialization (two-pass filtering!)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractConversionFilter

public AbstractConversionFilter()
Method Detail

filter

public MultipleObjectsBundle filter(MultipleObjectsBundle objects)
A standard implementation of the filter process. First of all, all suitable representations are found. Then (if prepareStart(de.lmu.ifi.dbs.elki.data.type.SimpleTypeInformation) returns true), the data is processed read-only in a first pass. In the main pass, each object is then filtered using filterSingleObject(I).

Specified by:
filter in interface ObjectFilter
Parameters:
objects - Object to filter
Returns:
Filtered objects

filterSingleObject

protected abstract O filterSingleObject(I obj)
Normalize a single instance. You can implement this as UnsupportedOperationException if you override both public "normalize" functions!

Parameters:
obj - Database object to normalize
Returns:
Normalized database object

getInputTypeRestriction

protected abstract SimpleTypeInformation<? super I> getInputTypeRestriction()
Get the input type restriction used for negotiating the data query.

Returns:
Type restriction

convertedType

protected abstract SimpleTypeInformation<? super O> convertedType(SimpleTypeInformation<I> in)
Get the output type from the input type after conversion.

Parameters:
in - input type restriction
Returns:
output type restriction

prepareStart

protected boolean prepareStart(SimpleTypeInformation<I> in)
Return "true" when the normalization needs initialization (two-pass filtering!)

Parameters:
in - Input type information
Returns:
true or false

prepareProcessInstance

protected void prepareProcessInstance(I obj)
Process a single object during initialization.

Parameters:
obj - Object to process

prepareComplete

protected void prepareComplete()
Complete the initialization phase


Release 0.4.0 (2011-09-20_1324)