Class ReportFieldFromStringValue

  • 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 ReportFieldFromStringValue
    extends adams.data.filter.AbstractFilter<Spectrum>
    Sets a report field with the value extracted from another string field via a regular expression.
    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

        adams.data.filter.AbstractFilter.FilterJob<T extends adams.data.container.DataContainer>
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected adams.data.conversion.Conversion m_Conversion
      the conversion to apply.
      protected String m_Group
      the group to use as value for the target field.
      protected adams.core.base.BaseRegExp m_RegExp
      the regular expression to apply.
      protected adams.data.report.Field m_Source
      the source field.
      protected adams.data.report.Field m_Target
      the target field.
      • 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
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      String conversionTipText()
      Returns the tip text for this property.
      void defineOptions()
      Adds options to the internal list of options.
      adams.data.conversion.Conversion getConversion()
      Returns the conversion to apply to the extracted string value.
      String getGroup()
      Returns group expression for generating the value to be stored.
      adams.core.base.BaseRegExp getRegExp()
      Returns the regular expression to apply for identifying the group(s) to extract from the string.
      adams.data.report.Field getSource()
      Returns the source field in the report to get the string to apply the regular expression to.
      adams.data.report.Field getTarget()
      Returns the target field in the report to store the result in.
      String globalInfo()
      Returns a string describing the object.
      String groupTipText()
      Returns the tip text for this property.
      protected Spectrum processData​(Spectrum data)
      Performs the actual filtering.
      String regExpTipText()
      Returns the tip text for this property.
      void setConversion​(adams.data.conversion.Conversion value)
      Sets the conversion to apply to the extracted string value.
      void setGroup​(String value)
      Sets the group expression for generating the value to be stored.
      void setRegExp​(adams.core.base.BaseRegExp value)
      Sets the regular expression to apply for identifying the group(s) to extract from the string.
      void setSource​(adams.data.report.Field value)
      Sets the source field in the report to get the string to apply the regular expression to.
      void setTarget​(adams.data.report.Field value)
      Sets the target field in the report to store the result in.
      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, reset, 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 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_Source

        protected adams.data.report.Field m_Source
        the source field.
      • m_RegExp

        protected adams.core.base.BaseRegExp m_RegExp
        the regular expression to apply.
      • m_Group

        protected String m_Group
        the group to use as value for the target field.
      • m_Conversion

        protected adams.data.conversion.Conversion m_Conversion
        the conversion to apply.
      • m_Target

        protected adams.data.report.Field m_Target
        the target field.
    • Constructor Detail

      • ReportFieldFromStringValue

        public ReportFieldFromStringValue()
    • Method Detail

      • globalInfo

        public String globalInfo()
        Returns a string describing the object.
        Specified by:
        globalInfo in interface adams.core.GlobalInfoSupporter
        Specified by:
        globalInfo in class adams.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 interface adams.core.option.OptionHandler
        Overrides:
        defineOptions in class adams.data.filter.AbstractFilter<Spectrum>
      • setSource

        public void setSource​(adams.data.report.Field value)
        Sets the source field in the report to get the string to apply the regular expression to.
        Parameters:
        value - the field
      • getSource

        public adams.data.report.Field getSource()
        Returns the source field in the report to get the string to apply the regular expression to.
        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.
      • setRegExp

        public void setRegExp​(adams.core.base.BaseRegExp value)
        Sets the regular expression to apply for identifying the group(s) to extract from the string.
        Parameters:
        value - the expression
      • getRegExp

        public adams.core.base.BaseRegExp getRegExp()
        Returns the regular expression to apply for identifying the group(s) to extract from the string.
        Returns:
        the expression
      • regExpTipText

        public String regExpTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setGroup

        public void setGroup​(String value)
        Sets the group expression for generating the value to be stored.
        Parameters:
        value - the group expression
      • getGroup

        public String getGroup()
        Returns group expression for generating the value to be stored.
        Returns:
        the group expression
      • groupTipText

        public String groupTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setConversion

        public void setConversion​(adams.data.conversion.Conversion value)
        Sets the conversion to apply to the extracted string value.
        Parameters:
        value - the conversion
      • getConversion

        public adams.data.conversion.Conversion getConversion()
        Returns the conversion to apply to the extracted string value.
        Returns:
        the conversion
      • conversionTipText

        public String conversionTipText()
        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 in the report to store the result in.
        Parameters:
        value - the field
      • getTarget

        public adams.data.report.Field getTarget()
        Returns the target field in the report to store the result in.
        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.
      • processData

        protected Spectrum processData​(Spectrum data)
        Performs the actual filtering.
        Specified by:
        processData in class adams.data.filter.AbstractFilter<Spectrum>
        Parameters:
        data - the data to filter
        Returns:
        the filtered data