Class AbstractConversionFilter<I,​O>

  • Type Parameters:
    I - Input object type
    O - Input object type
    All Implemented Interfaces:
    elki.datasource.filter.ObjectFilter
    Direct Known Subclasses:
    AbstractVectorConversionFilter, SparseVectorFieldFilter

    public abstract class AbstractConversionFilter<I,​O>
    extends java.lang.Object
    implements elki.datasource.filter.ObjectFilter
    Abstract base class for simple conversion filters such as normalizations and projections.
    Since:
    0.4.0
    Author:
    Erich Schubert
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      protected abstract elki.data.type.SimpleTypeInformation<? super O> convertedType​(elki.data.type.SimpleTypeInformation<I> in)
      Get the output type from the input type after conversion.
      elki.datasource.bundle.MultipleObjectsBundle filter​(elki.datasource.bundle.MultipleObjectsBundle objects)
      A standard implementation of the filter process.
      protected abstract O filterSingleObject​(I obj)
      Normalize a single instance.
      protected abstract elki.data.type.SimpleTypeInformation<? super I> getInputTypeRestriction()
      Get the input type restriction used for negotiating the data query.
      protected abstract elki.logging.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​(elki.data.type.SimpleTypeInformation<I> in)
      Return "true" when the normalization needs initialization (two-pass filtering!).
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • AbstractConversionFilter

        public AbstractConversionFilter()
    • Method Detail

      • filter

        public elki.datasource.bundle.MultipleObjectsBundle filter​(elki.datasource.bundle.MultipleObjectsBundle objects)
        A standard implementation of the filter process. First of all, all suitable representations are found. Then (if prepareStart(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 using filterSingleObject(I).
        Specified by:
        filter in interface elki.datasource.filter.ObjectFilter
        Parameters:
        objects - Objects to filter
        Returns:
        Filtered bundle
      • getLogger

        protected abstract elki.logging.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 elki.data.type.SimpleTypeInformation<? super I> getInputTypeRestriction()
        Get the input type restriction used for negotiating the data query.
        Returns:
        Type restriction
      • convertedType

        protected abstract elki.data.type.SimpleTypeInformation<? super O> convertedType​(elki.data.type.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​(elki.data.type.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 class java.lang.Object