Class AbstractFilter<T extends DataContainer>

    • Field Detail

      • m_DontUpdateID

        protected boolean m_DontUpdateID
        whether to suppress updating of ID.
    • Constructor Detail

      • AbstractFilter

        public AbstractFilter()
    • Method Detail

      • setDontUpdateID

        public void setDontUpdateID​(boolean value)
        Sets whether ID update is suppressed.
        Specified by:
        setDontUpdateID in interface Filter<T extends DataContainer>
        Parameters:
        value - true if to suppress
      • getDontUpdateID

        public boolean getDontUpdateID()
        Returns whether ID update is suppressed.
        Specified by:
        getDontUpdateID in interface Filter<T extends DataContainer>
        Returns:
        true if suppressed
      • dontUpdateIDTipText

        public String dontUpdateIDTipText()
        Returns the tip text for this property.
        Specified by:
        dontUpdateIDTipText in interface Filter<T extends DataContainer>
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • reset

        public void reset()
        Resets the filter. Derived classes must call this method in set-methods of parameters to assure the invalidation of previously generated data.
        Specified by:
        reset in interface Filter<T extends DataContainer>
        Overrides:
        reset in class AbstractOptionHandler
      • cleanUp

        public void cleanUp()
        Cleans up data structures, frees up memory. Sets the input and generated data to null.
        Specified by:
        cleanUp in interface CleanUpHandler
        Specified by:
        cleanUp in interface Filter<T extends DataContainer>
      • filter

        public T filter​(T data)
        Returns the filtered data.
        Specified by:
        filter in interface Filter<T extends DataContainer>
        Parameters:
        data - the data to filter
        Returns:
        the filtered data
      • checkData

        protected void checkData​(T data)
        The default implementation only checks whether there is any data set.
        Parameters:
        data - the data to filter
      • processData

        protected abstract T processData​(T data)
        Performs the actual filtering.
        Parameters:
        data - the data to filter
        Returns:
        the filtered data
      • compareTo

        public int compareTo​(Object o)
        Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

        Only compares the commandlines of the two objects.
        Specified by:
        compareTo in interface Comparable<T extends DataContainer>
        Specified by:
        compareTo in interface Filter<T extends DataContainer>
        Parameters:
        o - the object to be compared.
        Returns:
        a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
        Throws:
        ClassCastException - if the specified object's type prevents it from being compared to this object.
      • equals

        public boolean equals​(Object o)
        Returns whether the two objects are the same.

        Only compares the commandlines of the two objects.
        Specified by:
        equals in interface Filter<T extends DataContainer>
        Overrides:
        equals in class Object
        Parameters:
        o - the object to be compared
        Returns:
        true if the object is the same as this one
      • forCommandLine

        public static Filter forCommandLine​(String cmdline)
        Instantiates the filter from the given commandline (i.e., classname and optional options).
        Parameters:
        cmdline - the classname (and optional options) of the filter to instantiate
        Returns:
        the instantiated filter or null if an error occurred