Package weka.filters

Class MultiFilter

All Implemented Interfaces:
Serializable, CapabilitiesHandler, OptionHandler, RevisionHandler, StreamableFilter

public class MultiFilter extends SimpleStreamFilter
Applies several filters successively. In case all supplied filters are StreamableFilters, it will act as a streamable one, too.

Valid options are:

 -D
  Turns on output of debugging information.
 -F <classname [options]>
  A filter to apply (can be specified multiple times).
Version:
$Revision: 9718 $
Author:
FracPete (fracpete at waikato dot ac dot nz)
See Also:
  • Constructor Details

    • MultiFilter

      public MultiFilter()
  • Method Details

    • globalInfo

      public String globalInfo()
      Returns a string describing this filter
      Specified by:
      globalInfo in class SimpleFilter
      Returns:
      a description of the filter suitable for displaying in the explorer/experimenter gui
    • listOptions

      public Enumeration listOptions()
      Returns an enumeration describing the available options.
      Specified by:
      listOptions in interface OptionHandler
      Overrides:
      listOptions in class SimpleFilter
      Returns:
      an enumeration of all the available options.
    • setOptions

      public void setOptions(String[] options) throws Exception
      Parses a list of options for this object.

      Valid options are:

       -D
        Turns on output of debugging information.
       -F <classname [options]>
        A filter to apply (can be specified multiple times).
      Specified by:
      setOptions in interface OptionHandler
      Overrides:
      setOptions in class SimpleFilter
      Parameters:
      options - the list of options as an array of strings
      Throws:
      Exception - if an option is not supported
      See Also:
      • SimpleFilter.reset()
    • getOptions

      public String[] getOptions()
      Gets the current settings of the filter.
      Specified by:
      getOptions in interface OptionHandler
      Overrides:
      getOptions in class SimpleFilter
      Returns:
      an array of strings suitable for passing to setOptions
    • getCapabilities

      public Capabilities getCapabilities()
      Returns the Capabilities of this filter.
      Specified by:
      getCapabilities in interface CapabilitiesHandler
      Overrides:
      getCapabilities in class Filter
      Returns:
      the capabilities of this object
      See Also:
    • setFilters

      public void setFilters(Filter[] filters)
      Sets the list of possible filters to choose from. Also resets the state of the filter (this reset doesn't affect the options).
      Parameters:
      filters - an array of filters with all options set.
      See Also:
      • reset()
    • getFilters

      public Filter[] getFilters()
      Gets the list of possible filters to choose from.
      Returns:
      the array of Filters
    • filtersTipText

      public String filtersTipText()
      Returns the tip text for this property
      Returns:
      tip text for this property suitable for displaying in the explorer/experimenter gui
    • getFilter

      public Filter getFilter(int index)
      Gets a single filter from the set of available filters.
      Parameters:
      index - the index of the filter wanted
      Returns:
      the Filter
    • isStreamableFilter

      public boolean isStreamableFilter()
      tests whether all the enclosed filters are streamable
      Returns:
      true if all the enclosed filters are streamable
    • batchFinished

      public boolean batchFinished() throws Exception
      Signify that this batch of input to the filter is finished. If the filter requires all instances prior to filtering, output() may now be called to retrieve the filtered instances. Any subsequent instances filtered should be filtered based on setting obtained from the first batch (unless the setInputFormat has been re-assigned or new options have been set).
      Overrides:
      batchFinished in class SimpleStreamFilter
      Returns:
      true if there are instances pending output
      Throws:
      IllegalStateException - if no input format has been set.
      Exception - if there was a problem finishing the batch.
    • getRevision

      public String getRevision()
      Returns the revision string.
      Specified by:
      getRevision in interface RevisionHandler
      Overrides:
      getRevision in class Filter
      Returns:
      the revision
    • main

      public static void main(String[] args)
      Main method for executing this class.
      Parameters:
      args - should contain arguments for the filter: use -h for help