Package adams.data.baseline
Class AbstractBaselineCorrection<T extends DataContainer>
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.data.baseline.AbstractBaselineCorrection<T>
-
- Type Parameters:
T
- the type of data to process
- All Implemented Interfaces:
CleanUpHandler
,Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,ShallowCopySupporter<AbstractBaselineCorrection>
,SizeOfHandler
,Serializable
,Comparable
- Direct Known Subclasses:
AbstractDatabaseConnectionBaselineCorrection
,AbstractLinearRegressionBased
,AbstractLOWESSBased
,AbstractSavitzkyGolayBased
,PassThrough
public abstract class AbstractBaselineCorrection<T extends DataContainer> extends AbstractOptionHandler implements Comparable, CleanUpHandler, ShallowCopySupporter<AbstractBaselineCorrection>
Abstract base class for baseline correction schemes. Derived classes only have to override theprocessData(T)
method. Thereset()
method can be used to reset an algorithms internal state.- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AbstractBaselineCorrection.BaselineCorrectionJob<T extends DataContainer>
A job class specific to baseline correction schemes.
-
Field Summary
-
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 AbstractBaselineCorrection()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected void
checkData(T data)
The default implementation only checks whether there is any data set.void
cleanUp()
Cleans up data structures, frees up memory.int
compareTo(Object o)
Compares this object with the specified object for order.T
correct(T data)
Corrects the data.protected T
doCorrect(T data)
Performs checks and corrects the data.boolean
equals(Object o)
Returns whether the two objects are the same.static AbstractBaselineCorrection
forCommandLine(String cmdline)
Instantiates the baseline correction scheme from the given commandline (i.e., classname and optional options).protected abstract T
processData(T data)
Performs the actual correcting.protected void
reset()
Resets the baseline correction scheme.AbstractBaselineCorrection
shallowCopy()
Returns a shallow copy of itself, i.e., based on the commandline options.AbstractBaselineCorrection
shallowCopy(boolean expand)
Returns a shallow copy of itself, i.e., based on the commandline options.-
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, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel
-
-
-
-
Method Detail
-
reset
protected void reset()
Resets the baseline correction scheme. Derived classes must call this method in set-methods of parameters to assure the invalidation of previously generated data.- Overrides:
reset
in classAbstractOptionHandler
-
cleanUp
public void cleanUp()
Cleans up data structures, frees up memory. Sets the input data to null.- Specified by:
cleanUp
in interfaceCleanUpHandler
-
correct
public T correct(T data)
Corrects the data.- Parameters:
data
- the data to correct- Returns:
- the corrected data
-
doCorrect
protected T doCorrect(T data)
Performs checks and corrects the data.- Parameters:
data
- the data to correct- Returns:
- the corrected data
-
checkData
protected void checkData(T data)
The default implementation only checks whether there is any data set.- Parameters:
data
- the data to correct
-
processData
protected abstract T processData(T data)
Performs the actual correcting.- Parameters:
data
- the data to correct- Returns:
- the corrected data
-
shallowCopy
public AbstractBaselineCorrection shallowCopy()
Returns a shallow copy of itself, i.e., based on the commandline options.- Specified by:
shallowCopy
in interfaceShallowCopySupporter<T extends DataContainer>
- Returns:
- the shallow copy
-
shallowCopy
public AbstractBaselineCorrection shallowCopy(boolean expand)
Returns a shallow copy of itself, i.e., based on the commandline options.- Specified by:
shallowCopy
in interfaceShallowCopySupporter<T extends DataContainer>
- Parameters:
expand
- whether to expand variables to their current values- Returns:
- the shallow copy
-
compareTo
public int compareTo(Object o)
Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
Only compares the commandlines of the two objects.- Specified by:
compareTo
in interfaceComparable<T extends DataContainer>
- Parameters:
o
- the object to be compared.- Returns:
- a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
- Throws:
ClassCastException
- if the specified object's type prevents it from being compared to this object.
-
equals
public boolean equals(Object o)
Returns whether the two objects are the same.
Only compares the commandlines of the two objects.
-
forCommandLine
public static AbstractBaselineCorrection forCommandLine(String cmdline)
Instantiates the baseline correction scheme from the given commandline (i.e., classname and optional options).- Parameters:
cmdline
- the classname (and optional options) of the baseline correction scheme to instantiate- Returns:
- the instantiated baseline correction scheme or null if an error occurred
-
-