Package adams.data.wavefilter
Class Trim
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.data.wavefilter.AbstractWaveFilter
-
- adams.data.wavefilter.Trim
-
- All Implemented Interfaces:
adams.core.Destroyable
,adams.core.GlobalInfoSupporter
,adams.core.logging.LoggingLevelHandler
,adams.core.logging.LoggingSupporter
,adams.core.option.OptionHandler
,adams.core.QuickInfoSupporter
,adams.core.SizeOfHandler
,adams.data.InPlaceProcessing
,Serializable
public class Trim extends AbstractWaveFilter implements adams.data.InPlaceProcessing
Trims the Wave object left and/or right, using either sample number of time in seconds.
Only works if 'subChunk2Id' is 'data' not 'LIST'.
-logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel) The logging level for outputting errors and debugging output. default: WARNING
-type <SAMPLES|SECONDS> (property: type) How to interpret the left/right values. default: SAMPLES
-left <double> (property: left) The starting point of the trimming. default: 0.0 minimum: 0.0
-right <double> (property: right) The end point of the trimming; ignored if 0. default: 0.0 minimum: 0.0
-no-copy <boolean> (property: noCopy) If enabled, no copy of the Wave is created before trimming it. default: false
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected double
m_Left
the left trim.protected boolean
m_NoCopy
whether to skip creating a copy of the container.protected double
m_Right
the right trim.protected WaveIndexingType
m_Type
how to trim.
-
Constructor Summary
Constructors Constructor Description Trim()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
defineOptions()
Adds options to the internal list of options.double
getLeft()
Returns the starting point of the trim.boolean
getNoCopy()
Returns whether to skip creating a copy of the wave before trimming.String
getQuickInfo()
Returns a quick info about the actor, which will be displayed in the GUI.double
getRight()
Returns the end point of the trim.WaveIndexingType
getType()
Returns the trim type in use.String
globalInfo()
Returns a string describing the object.String
leftTipText()
Returns the tip text for this property.String
noCopyTipText()
Returns the tip text for this property.protected WaveContainer
processData(WaveContainer data)
Performs the actual filtering.String
rightTipText()
Returns the tip text for this property.void
setLeft(double value)
Sets the starting point of the trim.void
setNoCopy(boolean value)
Sets whether to skip creating a copy of the wave before trimming.void
setRight(double value)
Sets the end point of the trim.void
setType(WaveIndexingType value)
Sets the trim type to use.String
typeTipText()
Returns the tip text for this property.-
Methods inherited from class adams.data.wavefilter.AbstractWaveFilter
checkData, filter
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, initialize, loggingLevelTipText, newOptionManager, reset, setLoggingLevel, toCommandLine, toString
-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
-
-
-
Field Detail
-
m_Type
protected WaveIndexingType m_Type
how to trim.
-
m_Left
protected double m_Left
the left trim.
-
m_Right
protected double m_Right
the right trim.
-
m_NoCopy
protected boolean m_NoCopy
whether to skip creating a copy of the container.
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing the object.- Specified by:
globalInfo
in interfaceadams.core.GlobalInfoSupporter
- Specified by:
globalInfo
in classadams.core.option.AbstractOptionHandler
- Returns:
- a description suitable for displaying in the gui
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptions
in interfaceadams.core.option.OptionHandler
- Overrides:
defineOptions
in classadams.core.option.AbstractOptionHandler
-
setType
public void setType(WaveIndexingType value)
Sets the trim type to use.- Parameters:
value
- the type
-
getType
public WaveIndexingType getType()
Returns the trim type in use.- Returns:
- the type
-
typeTipText
public String typeTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setLeft
public void setLeft(double value)
Sets the starting point of the trim.- Parameters:
value
- the starting point
-
getLeft
public double getLeft()
Returns the starting point of the trim.- Returns:
- the starting point
-
leftTipText
public String leftTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setRight
public void setRight(double value)
Sets the end point of the trim.- Parameters:
value
- the end point
-
getRight
public double getRight()
Returns the end point of the trim.- Returns:
- the end point
-
rightTipText
public String rightTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setNoCopy
public void setNoCopy(boolean value)
Sets whether to skip creating a copy of the wave before trimming.- Specified by:
setNoCopy
in interfaceadams.data.InPlaceProcessing
- Parameters:
value
- true if to skip creating copy
-
getNoCopy
public boolean getNoCopy()
Returns whether to skip creating a copy of the wave before trimming.- Specified by:
getNoCopy
in interfaceadams.data.InPlaceProcessing
- Returns:
- true if copying is skipped
-
noCopyTipText
public String noCopyTipText()
Returns the tip text for this property.- Specified by:
noCopyTipText
in interfaceadams.data.InPlaceProcessing
- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
getQuickInfo
public String getQuickInfo()
Returns a quick info about the actor, which will be displayed in the GUI.- Specified by:
getQuickInfo
in interfaceadams.core.QuickInfoSupporter
- Overrides:
getQuickInfo
in classAbstractWaveFilter
- Returns:
- null if no info available, otherwise short string
-
processData
protected WaveContainer processData(WaveContainer data)
Performs the actual filtering.- Specified by:
processData
in classAbstractWaveFilter
- Parameters:
data
- the data to filter- Returns:
- the filtered data
-
-