Class AbstractSampleIDExtraction

  • 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
    Direct Known Subclasses:
    Filename, RegExp

    public abstract class AbstractSampleIDExtraction
    extends adams.core.option.AbstractOptionHandler
    implements SampleIDExtraction
    Ancestor for schemes that extract the sample ID from the filename.
    Version:
    $Revision$
    Author:
    FracPete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • 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
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      protected void check​(File file, Spectrum spec)
      Performs checks before the actual extraction.
      protected abstract String doExtract​(File file, Spectrum spec)
      Performs the actual extraction.
      String extract​(File file, Spectrum spec)
      Performs the extraction.
      • Methods inherited from class adams.core.option.AbstractOptionHandler

        cleanUpOptions, defineOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, globalInfo, 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
    • Constructor Detail

      • AbstractSampleIDExtraction

        public AbstractSampleIDExtraction()
    • Method Detail

      • check

        protected void check​(File file,
                             Spectrum spec)
        Performs checks before the actual extraction.
        Parameters:
        file - the current file
        spec - the current spectrum
      • doExtract

        protected abstract String doExtract​(File file,
                                            Spectrum spec)
        Performs the actual extraction.
        Parameters:
        file - the current file
        spec - the current spectrum
        Returns:
        the extracted sample ID
      • extract

        public String extract​(File file,
                              Spectrum spec)
        Performs the extraction.
        Specified by:
        extract in interface SampleIDExtraction
        Parameters:
        file - the current file
        spec - the current spectrum
        Returns:
        the extracted sample ID