Package elki.datasource.filter
Class AbstractConversionFilter<I,O>
- java.lang.Object
-
- elki.datasource.filter.AbstractConversionFilter<I,O>
-
- Type Parameters:
I
- Input object typeO
- Input object type
- All Implemented Interfaces:
ObjectFilter
- Direct Known Subclasses:
AbstractVectorConversionFilter
,SparseVectorFieldFilter
,UncertainSplitFilter
,WeightedUncertainSplitFilter
public abstract class AbstractConversionFilter<I,O> extends java.lang.Object implements ObjectFilter
Abstract base class for simple conversion filters such as normalizations and projections.- Since:
- 0.4.0
- Author:
- Erich Schubert
-
-
Constructor Summary
Constructors Constructor Description AbstractConversionFilter()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description 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 abstract Logging
getLogger()
Class logger.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!).java.lang.String
toString()
-
-
-
Method Detail
-
filter
public MultipleObjectsBundle filter(MultipleObjectsBundle objects)
A standard implementation of the filter process. First of all, all suitable representations are found. Then (ifprepareStart(elki.data.type.SimpleTypeInformation<I>)
returns true), the data is processed read-only in a first pass. In the main pass, each object is then filtered usingfilterSingleObject(I)
.- Specified by:
filter
in interfaceObjectFilter
- Parameters:
objects
- Objects to filter- Returns:
- Filtered bundle
-
getLogger
protected abstract Logging getLogger()
Class logger.- Returns:
- Logger
-
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.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-