public class MultiFilter extends SimpleStreamFilter
-D Turns on output of debugging information.
-F <classname [options]> A filter to apply (can be specified multiple times).
StreamableFilter
,
Serialized FormModifier and Type | Field and Description |
---|---|
protected Filter[] |
m_Filters
The filters
|
protected boolean |
m_Streamable
caches the streamable state
|
protected boolean |
m_StreamableChecked
whether we already checked the streamable state
|
m_Debug
m_FirstBatchDone, m_InputRelAtts, m_InputStringAtts, m_NewBatch, m_OutputRelAtts, m_OutputStringAtts
Constructor and Description |
---|
MultiFilter() |
Modifier and Type | Method and Description |
---|---|
boolean |
batchFinished()
Signify that this batch of input to the filter is finished.
|
protected Instances |
determineOutputFormat(Instances inputFormat)
Determines the output format based on the input format and returns
this.
|
String |
filtersTipText()
Returns the tip text for this property
|
Capabilities |
getCapabilities()
Returns the Capabilities of this filter.
|
Filter |
getFilter(int index)
Gets a single filter from the set of available filters.
|
Filter[] |
getFilters()
Gets the list of possible filters to choose from.
|
protected String |
getFilterSpec(Filter filter)
returns the filter classname and the options as one string
|
String[] |
getOptions()
Gets the current settings of the filter.
|
String |
getRevision()
Returns the revision string.
|
String |
globalInfo()
Returns a string describing this filter
|
protected boolean |
hasImmediateOutputFormat()
Returns true if the output format is immediately available after the
input format has been set and not only after all the data has been
seen (see batchFinished()).
|
boolean |
isStreamableFilter()
tests whether all the enclosed filters are streamable
|
Enumeration |
listOptions()
Returns an enumeration describing the available options.
|
static void |
main(String[] args)
Main method for executing this class.
|
protected Instance |
process(Instance instance)
processes the given instance (may change the provided instance) and
returns the modified version.
|
protected Instances |
process(Instances instances)
Processes the given data (may change the provided dataset) and returns
the modified version.
|
protected void |
reset()
resets the filter, i.e., m_NewBatch to true and m_FirstBatchDone to
false.
|
void |
setFilters(Filter[] filters)
Sets the list of possible filters to choose from.
|
void |
setOptions(String[] options)
Parses a list of options for this object.
|
input, preprocess
debugTipText, getDebug, setDebug, setInputFormat
batchFilterFile, bufferInput, copyValues, copyValues, filterFile, flushInput, getCapabilities, getInputFormat, getOutputFormat, initInputLocators, initOutputLocators, inputFormatPeek, isFirstBatchDone, isNewBatch, isOutputFormatDefined, makeCopies, makeCopy, numPendingOutput, output, outputFormatPeek, outputPeek, push, resetQueue, runFilter, setOutputFormat, testInputFormat, toString, useFilter, wekaStaticWrapper
protected Filter[] m_Filters
protected boolean m_Streamable
protected boolean m_StreamableChecked
public String globalInfo()
globalInfo
in class SimpleFilter
public Enumeration listOptions()
listOptions
in interface OptionHandler
listOptions
in class SimpleFilter
public void setOptions(String[] options) throws Exception
-D Turns on output of debugging information.
-F <classname [options]> A filter to apply (can be specified multiple times).
setOptions
in interface OptionHandler
setOptions
in class SimpleFilter
options
- the list of options as an array of stringsException
- if an option is not supportedSimpleFilter.reset()
public String[] getOptions()
getOptions
in interface OptionHandler
getOptions
in class SimpleFilter
public Capabilities getCapabilities()
getCapabilities
in interface CapabilitiesHandler
getCapabilities
in class Filter
Capabilities
protected void reset()
reset
in class SimpleFilter
Filter.m_NewBatch
,
Filter.m_FirstBatchDone
public void setFilters(Filter[] filters)
filters
- an array of filters with all options set.reset()
public Filter[] getFilters()
public String filtersTipText()
public Filter getFilter(int index)
index
- the index of the filter wantedprotected String getFilterSpec(Filter filter)
filter
- the filter to get the specs forpublic boolean isStreamableFilter()
protected boolean hasImmediateOutputFormat()
hasImmediateOutputFormat
in class SimpleStreamFilter
batchFinished()
,
SimpleFilter.setInputFormat(Instances)
,
Filter.m_FirstBatchDone
protected Instances determineOutputFormat(Instances inputFormat) throws Exception
determineOutputFormat
in class SimpleStreamFilter
inputFormat
- the input format to base the output format onException
- in case the determination goes wronghasImmediateOutputFormat()
,
batchFinished()
,
SimpleStreamFilter.preprocess(Instances)
protected Instance process(Instance instance) throws Exception
process
in class SimpleStreamFilter
instance
- the instance to processException
- in case the processing goes wrongprotected Instances process(Instances instances) throws Exception
process
in class SimpleStreamFilter
instances
- the data to processException
- in case the processing goes wrongbatchFinished()
,
process(Instance)
public boolean batchFinished() throws Exception
batchFinished
in class SimpleStreamFilter
IllegalStateException
- if no input format has been set.NullPointerException
- if no input structure has been defined,Exception
- if there was a problem finishing the batch.public String getRevision()
getRevision
in interface RevisionHandler
getRevision
in class Filter
public static void main(String[] args)
args
- should contain arguments for the filter: use -h for helpCopyright © 2015 University of Waikato, Hamilton, NZ. All rights reserved.