Class AbstractSpectrumReader

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected String m_Format
      the form of this data.
      protected String m_Instrument
      the instrument this data is from.
      protected boolean m_KeepFormat
      whether to not override the format obtained from the file.
      protected boolean m_Stopped
      whether reading was stopped.
      protected boolean m_UseAbsoluteSource
      whether to use absolute filename for the source report field or just the file's name.
      static String OPTION_OUTPUTDIR  
      • Fields inherited from class adams.data.io.input.AbstractDataContainerReader

        m_CreateDummyReport, m_Input, m_InputIsFile, m_Processed, m_ReadData
      • 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 Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void checkData()
      Hook method for checking the data.
      protected adams.data.report.Report createDummyReport​(Spectrum cont)
      Creates a dummy report.
      void defineOptions()
      Adds options to the internal list of options.
      String formatTipText()
      Returns the tip text for this property.
      protected String getDefaultFormat()
      Returns the default format of the spectra.
      protected String getDefaultInstrument()
      Returns the default instrument of the spectra.
      protected boolean getDefaultKeepFormat()
      Returns the default for keeping the format.
      protected boolean getDefaultUseAbsoluteSource()
      Returns the default for using absolute source filename.
      String getFormat()
      Returns the format string of the data.
      String getInstrument()
      Returns the instrument's name.
      boolean getKeepFormat()
      Returns whether to keep the format obtained from the file.
      static String[] getReaders()
      Returns a list with classnames of readers.
      boolean getUseAbsoluteSource()
      Returns whether to use absolute source filename rather than just name.
      String instrumentTipText()
      Returns the tip text for this property.
      String keepFormatTipText()
      Returns the tip text for this property.
      protected void postProcessData()
      Performs some post-processing.
      static void runReader​(Class env, Class reader, String[] args)
      Runs the reader from commandline.
      void setFormat​(String value)
      Sets the format string of the data (always converted to upper case).
      void setInstrument​(String value)
      Sets the instrument's name.
      void setKeepFormat​(boolean value)
      Sets whether to keep the format obtained from the file.
      void setUseAbsoluteSource​(boolean value)
      Sets whether to use absolute source filename rather than just name.
      void stopExecution()
      Stops the execution.
      String useAbsoluteSourceTipText()
      Returns the tip text for this property.
      • Methods inherited from class adams.data.io.input.AbstractDataContainerReader

        cleanUp, compareTo, createDummyReportTipText, destroy, doRead, equals, getAdditionalInformation, getCreateDummyReport, getDefaultFormatExtension, getFormatDescription, getFormatExtensions, getInput, initialize, inputTipText, isInputFile, read, readData, reset, setCreateDummyReport, setInput, shallowCopy, shallowCopy
      • Methods inherited from class adams.core.option.AbstractOptionHandler

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

      • m_Instrument

        protected String m_Instrument
        the instrument this data is from.
      • m_Format

        protected String m_Format
        the form of this data.
      • m_KeepFormat

        protected boolean m_KeepFormat
        whether to not override the format obtained from the file.
      • m_UseAbsoluteSource

        protected boolean m_UseAbsoluteSource
        whether to use absolute filename for the source report field or just the file's name.
      • m_Stopped

        protected boolean m_Stopped
        whether reading was stopped.
    • Constructor Detail

      • AbstractSpectrumReader

        public AbstractSpectrumReader()
    • Method Detail

      • 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.io.input.AbstractDataContainerReader<Spectrum>
      • getDefaultInstrument

        protected String getDefaultInstrument()
        Returns the default instrument of the spectra.
        Returns:
        the default
      • getDefaultFormat

        protected String getDefaultFormat()
        Returns the default format of the spectra.
        Returns:
        the default
      • getDefaultKeepFormat

        protected boolean getDefaultKeepFormat()
        Returns the default for keeping the format.
        Returns:
        the default
      • getDefaultUseAbsoluteSource

        protected boolean getDefaultUseAbsoluteSource()
        Returns the default for using absolute source filename.
        Returns:
        the default
      • setInstrument

        public void setInstrument​(String value)
        Sets the instrument's name.
        Parameters:
        value - the name
      • getInstrument

        public String getInstrument()
        Returns the instrument's name.
        Returns:
        the name
      • instrumentTipText

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

        public void setFormat​(String value)
        Sets the format string of the data (always converted to upper case). Use null to set default format.
        Parameters:
        value - the format
      • getFormat

        public String getFormat()
        Returns the format string of the data.
        Returns:
        the format
      • formatTipText

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

        public void setKeepFormat​(boolean value)
        Sets whether to keep the format obtained from the file.
        Parameters:
        value - true if to keep format
      • getKeepFormat

        public boolean getKeepFormat()
        Returns whether to keep the format obtained from the file.
        Returns:
        true if to keep format
      • keepFormatTipText

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

        public void setUseAbsoluteSource​(boolean value)
        Sets whether to use absolute source filename rather than just name.
        Parameters:
        value - true if to use absolute source
      • getUseAbsoluteSource

        public boolean getUseAbsoluteSource()
        Returns whether to use absolute source filename rather than just name.
        Returns:
        true if to use absolute source
      • useAbsoluteSourceTipText

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

        protected void checkData()
        Hook method for checking the data.
        Overrides:
        checkData in class adams.data.io.input.AbstractDataContainerReader<Spectrum>
      • createDummyReport

        protected adams.data.report.Report createDummyReport​(Spectrum cont)
        Creates a dummy report.
        Overrides:
        createDummyReport in class adams.data.io.input.AbstractDataContainerReader<Spectrum>
        Parameters:
        cont - the data container the dummy is for
        Returns:
        the dummy report or null
        See Also:
        AbstractDataContainerReader.m_CreateDummyReport, postProcessData()
      • postProcessData

        protected void postProcessData()
        Performs some post-processing.
        Overrides:
        postProcessData in class adams.data.io.input.AbstractDataContainerReader<Spectrum>
      • stopExecution

        public void stopExecution()
        Stops the execution.
        Specified by:
        stopExecution in interface adams.core.Stoppable
      • getReaders

        public static String[] getReaders()
        Returns a list with classnames of readers.
        Returns:
        the reader classnames
      • runReader

        public static void runReader​(Class env,
                                     Class reader,
                                     String[] args)
        Runs the reader from commandline.
        Parameters:
        env - the environment class to use
        reader - the reader to execute
        args - the commandline arguments, use --input to specify the input file/dir and --output-dir to specify directory to save them as .spec files