Package adams.data.spectrumfilter
Class ReportFieldFromStringValueWithLookup
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.data.filter.AbstractFilter<Spectrum>
-
- adams.data.spectrumfilter.ReportFieldFromStringValueWithLookup
-
- All Implemented Interfaces:
adams.core.CleanUpHandler
,adams.core.Destroyable
,adams.core.GlobalInfoSupporter
,adams.core.logging.LoggingLevelHandler
,adams.core.logging.LoggingSupporter
,adams.core.option.OptionHandler
,adams.core.ShallowCopySupporter<adams.data.filter.Filter>
,adams.core.SizeOfHandler
,adams.data.filter.Filter<Spectrum>
,Serializable
,Comparable
public class ReportFieldFromStringValueWithLookup extends adams.data.filter.AbstractFilter<Spectrum>
Extracts the first group from the regular expression matched against the report field value and uses this value as key in the provided lookup table generated from the specified key-value pairs.- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected adams.core.base.BaseRegExp
m_Extract
the regexp to extract the lookup key (uses 1st group).protected adams.core.base.BaseKeyValuePair[]
m_Lookup
the key-value pairs.protected adams.data.report.Field
m_Source
the report field to read from.protected Map<String,String>
m_Table
the lookup table.protected adams.data.report.Field
m_Target
the report field to store the result in.
-
Constructor Summary
Constructors Constructor Description ReportFieldFromStringValueWithLookup()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
defineOptions()
Adds options to the internal list of options.String
extractTipText()
Returns the tip text for this property.adams.core.base.BaseRegExp
getExtract()
Returns the regexp for extracting the substring to use in the lookup.adams.core.base.BaseKeyValuePair[]
getLookup()
Returns the key-value pairs that make up the lookup table.adams.data.report.Field
getSource()
Returns the source field to use.adams.data.report.Field
getTarget()
Returns the target field to use for the result.String
globalInfo()
Returns a string describing the object.String
lookupTipText()
Returns the tip text for this property.protected Spectrum
processData(Spectrum data)
Performs the actual filtering.void
reset()
Resets the scheme.void
setExtract(adams.core.base.BaseRegExp value)
Sets the regexp for extracting the substring to use in the lookup.void
setLookup(adams.core.base.BaseKeyValuePair[] value)
Sets the key-value pairs that make up the lookup table.void
setSource(adams.data.report.Field value)
Sets the source field to use.void
setTarget(adams.data.report.Field value)
Sets the target field to use for the result.String
sourceTipText()
Returns the tip text for this property.String
targetTipText()
Returns the tip text for this property.-
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, 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
-
-
-
-
Field Detail
-
m_Source
protected adams.data.report.Field m_Source
the report field to read from.
-
m_Extract
protected adams.core.base.BaseRegExp m_Extract
the regexp to extract the lookup key (uses 1st group).
-
m_Lookup
protected adams.core.base.BaseKeyValuePair[] m_Lookup
the key-value pairs.
-
m_Target
protected adams.data.report.Field m_Target
the report field to store the result in.
-
-
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.data.filter.AbstractFilter<Spectrum>
-
reset
public void reset()
Resets the scheme.
-
setSource
public void setSource(adams.data.report.Field value)
Sets the source field to use.- Parameters:
value
- the field
-
getSource
public adams.data.report.Field getSource()
Returns the source field to use.- Returns:
- the field
-
sourceTipText
public String sourceTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setExtract
public void setExtract(adams.core.base.BaseRegExp value)
Sets the regexp for extracting the substring to use in the lookup.- Parameters:
value
- the expression
-
getExtract
public adams.core.base.BaseRegExp getExtract()
Returns the regexp for extracting the substring to use in the lookup.- Returns:
- the expression
-
extractTipText
public String extractTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setLookup
public void setLookup(adams.core.base.BaseKeyValuePair[] value)
Sets the key-value pairs that make up the lookup table.- Parameters:
value
- the pairs
-
getLookup
public adams.core.base.BaseKeyValuePair[] getLookup()
Returns the key-value pairs that make up the lookup table.- Returns:
- the pairs
-
lookupTipText
public String lookupTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setTarget
public void setTarget(adams.data.report.Field value)
Sets the target field to use for the result.- Parameters:
value
- the field
-
getTarget
public adams.data.report.Field getTarget()
Returns the target field to use for the result.- Returns:
- the field
-
targetTipText
public String targetTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
-