Package adams.ml.preprocessing
Class AbstractStreamFilter
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.ml.preprocessing.AbstractFilter
-
- adams.ml.preprocessing.AbstractStreamFilter
-
- All Implemented Interfaces:
Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,SizeOfHandler
,CapabilitiesHandler
,BatchFilter
,Filter
,StreamFilter
,Serializable
- Direct Known Subclasses:
MultiStream
,PassThrough
public abstract class AbstractStreamFilter extends AbstractFilter implements StreamFilter
Ancestor for stream filters.- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class adams.ml.preprocessing.AbstractFilter
m_Initialized, m_OutputFormat
-
Fields inherited from class adams.core.option.AbstractOptionHandler
m_OptionManager
-
Fields inherited from class adams.core.logging.LoggingObject
m_Logger, m_LoggingIsEnabled, m_LoggingLevel
-
-
Constructor Summary
Constructors Constructor Description AbstractStreamFilter()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract Row
doFilter(Row data)
Filters the dataset row coming through.protected abstract void
doInitFilter(Row data)
Filter-specific initialization.Row
filter(Row data)
Filters the dataset row coming through.Dataset
filter(Dataset data)
Filters the dataset coming through.protected void
initFilter(Row data)
Initializes the filter.protected abstract Dataset
initOutputFormat(Row data)
Initializes the output format.protected void
postInitFilter(Row data)
After the filter has been initialized.protected void
preInitFilter(Row data)
Before the actual filter initialization.-
Methods inherited from class adams.ml.preprocessing.AbstractFilter
appendData, appendHeader, getOutputFormat, isInitialized, reset
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, defineOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, globalInfo, initialize, loggingLevelTipText, newOptionManager, setLoggingLevel, toCommandLine, toString
-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface adams.ml.preprocessing.Filter
getCapabilities, getOutputFormat, isInitialized
-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel
-
-
-
-
Method Detail
-
preInitFilter
protected void preInitFilter(Row data) throws Exception
Before the actual filter initialization. Initializes the columns.- Parameters:
data
- the data to initialize with- Throws:
Exception
- if initialization fails
-
doInitFilter
protected abstract void doInitFilter(Row data) throws Exception
Filter-specific initialization.- Parameters:
data
- the data to initialize with- Throws:
Exception
- if initialization fails
-
initOutputFormat
protected abstract Dataset initOutputFormat(Row data) throws Exception
Initializes the output format.- Parameters:
data
- the output format- Throws:
Exception
- if initialization fails
-
postInitFilter
protected void postInitFilter(Row data) throws Exception
After the filter has been initialized. Sets the initialized flag.- Parameters:
data
- the data to initialize with- Throws:
Exception
- if initialization fails- See Also:
initOutputFormat(Row)
,AbstractFilter.isInitialized()
-
initFilter
protected void initFilter(Row data) throws Exception
Initializes the filter.- Parameters:
data
- the data to initialize with- Throws:
Exception
- if initialization fails- See Also:
preInitFilter(Row)
,doInitFilter(Row)
,postInitFilter(Row)
-
doFilter
protected abstract Row doFilter(Row data) throws Exception
Filters the dataset row coming through.- Parameters:
data
- the data to filter- Returns:
- the filtered data
- Throws:
Exception
- if filtering fails
-
filter
public Row filter(Row data) throws Exception
Filters the dataset row coming through.- Specified by:
filter
in interfaceStreamFilter
- Parameters:
data
- the data to filter- Returns:
- the filtered data
- Throws:
Exception
- if filtering fails
-
-