Package adams.data.filter
Class AbstractSAX<T extends DataContainer>
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.data.filter.AbstractFilter<T>
-
- adams.data.filter.AbstractSAX<T>
-
- Type Parameters:
T- the type of container to process
- All Implemented Interfaces:
CleanUpHandler,Destroyable,GlobalInfoSupporter,LoggingLevelHandler,LoggingSupporter,OptionHandler,ShallowCopySupporter<Filter>,SizeOfHandler,TechnicalInformationHandler,Filter<T>,Serializable,Comparable
- Direct Known Subclasses:
TimeseriesSAX
public abstract class AbstractSAX<T extends DataContainer> extends AbstractFilter<T> implements TechnicalInformationHandler
Ancestor for SAX filters.- Version:
- $Revision: 1286 $
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class adams.data.filter.AbstractFilter
AbstractFilter.FilterJob<T extends DataContainer>
-
-
Field Summary
Fields Modifier and Type Field Description protected double[]m_BreakPointsthe calculated breakpoints.protected double[][]m_DistMatrixthe matrix to use for the distance calculations.protected intm_NumBinsthe number of breakpoints to use (for the Gaussian).protected intm_NumWindowsthe number of windows to use for PAA.protected booleanm_OutputLabelswhether to output labels or the actual distances.-
Fields inherited from class adams.data.filter.AbstractFilter
m_DontUpdateID
-
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 AbstractSAX()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voiddefineOptions()Adds options to the internal list of options.protected abstract doublegetMeanDeltaX(T data)Computes the mean difference between data points on the X axis.intgetNumBins()Returns the number of bins to use for the Gaussian.intgetNumWindows()Returns the number of windows to use for PAA.booleangetOutputLabels()Returns whether to output labels or distances.TechnicalInformationgetTechnicalInformation()Returns an instance of a TechnicalInformation object, containing detailed information about the technical background of this class, e.g., paper reference or book this class is based on.protected abstract doublegetX(DataPoint point)Obtains the X value from the given data point.protected abstract doublegetY(DataPoint point)Obtains the Y value from the given data point.protected abstract DataPointnewDataPoint(double x, double y)Creates a new data point from the X and Y values.StringnumBinsTipText()Returns the tip text for this property.StringnumWindowsTipText()Returns the tip text for this property.StringoutputLabelsTipText()Returns the tip text for this property.protected TprocessData(T data)Performs the actual filtering.voidreset()Resets the filter.voidsetNumBins(int value)Sets the number of bins to use for the Gaussian.voidsetNumWindows(int value)Sets the number of windows to use for PAA.voidsetOutputLabels(boolean value)Sets whether to output labels or distances.-
Methods inherited from class adams.data.filter.AbstractFilter
checkData, cleanUp, compareTo, destroy, dontUpdateIDTipText, equals, filter, forCommandLine, getDontUpdateID, setDontUpdateID, shallowCopy, shallowCopy
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, 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, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel, setLoggingLevel
-
Methods inherited from interface adams.core.logging.LoggingSupporter
getLogger, isLoggingEnabled
-
Methods inherited from interface adams.core.option.OptionHandler
cleanUpOptions, getOptionManager, toCommandLine
-
-
-
-
Field Detail
-
m_NumWindows
protected int m_NumWindows
the number of windows to use for PAA.
-
m_NumBins
protected int m_NumBins
the number of breakpoints to use (for the Gaussian).
-
m_OutputLabels
protected boolean m_OutputLabels
whether to output labels or the actual distances.
-
m_BreakPoints
protected double[] m_BreakPoints
the calculated breakpoints.
-
m_DistMatrix
protected double[][] m_DistMatrix
the matrix to use for the distance calculations.
-
-
Method Detail
-
getTechnicalInformation
public TechnicalInformation getTechnicalInformation()
Returns an instance of a TechnicalInformation object, containing detailed information about the technical background of this class, e.g., paper reference or book this class is based on.- Specified by:
getTechnicalInformationin interfaceTechnicalInformationHandler- Returns:
- the technical information about this class
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptionsin interfaceOptionHandler- Overrides:
defineOptionsin classAbstractFilter<T extends DataContainer>
-
reset
public void reset()
Resets the filter.- Specified by:
resetin interfaceFilter<T extends DataContainer>- Overrides:
resetin classAbstractFilter<T extends DataContainer>
-
setNumWindows
public void setNumWindows(int value)
Sets the number of windows to use for PAA.- Parameters:
value- the number
-
getNumWindows
public int getNumWindows()
Returns the number of windows to use for PAA.- Returns:
- the number
-
numWindowsTipText
public String numWindowsTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setNumBins
public void setNumBins(int value)
Sets the number of bins to use for the Gaussian.- Parameters:
value- the number
-
getNumBins
public int getNumBins()
Returns the number of bins to use for the Gaussian.- Returns:
- the number
-
numBinsTipText
public String numBinsTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setOutputLabels
public void setOutputLabels(boolean value)
Sets whether to output labels or distances.- Parameters:
value- true if to output labels
-
getOutputLabels
public boolean getOutputLabels()
Returns whether to output labels or distances.- Returns:
- true if to output labels
-
outputLabelsTipText
public String outputLabelsTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
getMeanDeltaX
protected abstract double getMeanDeltaX(T data)
Computes the mean difference between data points on the X axis.- Parameters:
data- the data to use for the calculation- Returns:
- the mean
-
getX
protected abstract double getX(DataPoint point)
Obtains the X value from the given data point.- Parameters:
point- the data point to extract the X value from- Returns:
- the X value
-
getY
protected abstract double getY(DataPoint point)
Obtains the Y value from the given data point.- Parameters:
point- the data point to extract the Y value from- Returns:
- the Y value
-
newDataPoint
protected abstract DataPoint newDataPoint(double x, double y)
Creates a new data point from the X and Y values.- Parameters:
x- the raw X valuey- the raw Y value- Returns:
- the data point
-
processData
protected T processData(T data)
Performs the actual filtering.- Specified by:
processDatain classAbstractFilter<T extends DataContainer>- Parameters:
data- the data to filter- Returns:
- the filtered data
-
-