Class RegExp

  • All Implemented Interfaces:
    adams.core.Destroyable, adams.core.GlobalInfoSupporter, adams.core.logging.LoggingLevelHandler, adams.core.logging.LoggingSupporter, adams.core.option.OptionHandler, adams.core.SizeOfHandler, SampleIDExtraction, Serializable

    public class RegExp
    extends AbstractSampleIDExtraction
    Uses the specified group from a regular expression as sample ID.

    -logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel)
        The logging level for outputting errors and debugging output.
        default: WARNING
     
    -regexp <adams.core.base.BaseRegExp> (property: regExp)
        The regular expression for extracting the sample ID from the file name (
        w/o path).
        default: (.*)\\\\.txt
     
    -group <int> (property: group)
        The regular expression group that contains the sample ID.
        default: 1
        minimum: 1
     
    Version:
    $Revision$
    Author:
    FracPete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected int m_Group
      the regexp group to use.
      protected adams.core.base.BaseRegExp m_RegExp
      regexp to extract sample ID from file name.
      • 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
      RegExp()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void defineOptions()
      Adds options to the internal list of options.
      protected String doExtract​(File file, Spectrum spec)
      Performs the actual extraction.
      int getGroup()
      Returns the regular expression group that contains the sample ID from the file name (w/o path).
      adams.core.base.BaseRegExp getRegExp()
      Returns the regular expression in use to extract the sample ID from the file name (w/o path).
      String globalInfo()
      Returns a string describing the object.
      String groupTipText()
      Returns the tip text for this property.
      String regExpTipText()
      Returns the tip text for this property.
      void setGroup​(int value)
      Sets the regular expression group that contains the sample ID from the file name (w/o path).
      void setRegExp​(adams.core.base.BaseRegExp value)
      Sets the regular expression to use for extracting the sample ID from the file name (w/o path).
      • 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
      • Methods inherited from interface adams.core.logging.LoggingLevelHandler

        getLoggingLevel
    • Field Detail

      • m_RegExp

        protected adams.core.base.BaseRegExp m_RegExp
        regexp to extract sample ID from file name.
      • m_Group

        protected int m_Group
        the regexp group to use.
    • Constructor Detail

      • RegExp

        public RegExp()
    • 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.core.option.AbstractOptionHandler
      • setRegExp

        public void setRegExp​(adams.core.base.BaseRegExp value)
        Sets the regular expression to use for extracting the sample ID from the file name (w/o path).
        Parameters:
        value - the expression
      • getRegExp

        public adams.core.base.BaseRegExp getRegExp()
        Returns the regular expression in use to extract the sample ID from the file name (w/o path).
        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​(int value)
        Sets the regular expression group that contains the sample ID from the file name (w/o path).
        Parameters:
        value - the group
      • getGroup

        public int getGroup()
        Returns the regular expression group that contains the sample ID from the file name (w/o path).
        Returns:
        the group
      • 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.