Class GnuplotSpreadSheetReader

  • All Implemented Interfaces:
    adams.core.AdditionalInformationHandler, adams.core.Destroyable, adams.core.ErrorProvider, adams.core.GlobalInfoSupporter, adams.core.io.EncodingSupporter, adams.core.io.FileFormatHandler, adams.core.logging.LoggingLevelHandler, adams.core.logging.LoggingSupporter, adams.core.option.OptionHandler, adams.core.SizeOfHandler, adams.core.Stoppable, adams.core.StoppableWithFeedback, adams.data.io.input.MissingValueSpreadSheetReader, adams.data.io.input.SpreadSheetReader, adams.data.spreadsheet.DataRowTypeHandler, adams.data.spreadsheet.SpreadSheetTypeHandler, Serializable

    public class GnuplotSpreadSheetReader
    extends adams.data.io.input.AbstractSpreadSheetReaderWithMissingValueSupport
    Reads data in Gnuplot format.

    Valid options are:

    -logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel)
        The logging level for outputting errors and debugging output.
        default: WARNING
     
    -data-row-type <DENSE|SPARSE> (property: dataRowType)
        The type of row to use for the data.
        default: DENSE
     
    -missing <java.lang.String> (property: missingValue)
        The placeholder for missing values.
        default: -999
     
    Author:
    fracpete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Nested Class Summary

      • Nested classes/interfaces inherited from class adams.data.io.input.AbstractSpreadSheetReader

        adams.data.io.input.AbstractSpreadSheetReader.InputType
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static String COMMENT
      the line comment start.
      static String MISSING_VALUE
      the default for missing values.
      • Fields inherited from class adams.data.io.input.AbstractSpreadSheetReaderWithMissingValueSupport

        m_MissingValue
      • Fields inherited from class adams.data.io.input.AbstractSpreadSheetReader

        m_DataRowType, m_Encoding, m_LastError, m_SpreadSheetType, m_Stopped, OPTION_INPUT, OPTION_OUTPUT
      • 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 adams.data.spreadsheet.SpreadSheet doRead​(File file)
      Performs the actual reading.
      adams.data.io.output.SpreadSheetWriter getCorrespondingWriter()
      Returns, if available, the corresponding writer.
      protected adams.core.base.BaseRegExp getDefaultMissingValue()
      Returns the default missing value to use.
      String getFormatDescription()
      Returns a string describing the format (used in the file chooser).
      String[] getFormatExtensions()
      Returns the extension(s) of the format.
      protected adams.data.io.input.AbstractSpreadSheetReader.InputType getInputType()
      Returns how to read the data, from a file, stream or reader.
      String globalInfo()
      Returns a string describing the object.
      static void main​(String[] args)
      Runs the reader from the command-line.
      • Methods inherited from class adams.data.io.input.AbstractSpreadSheetReaderWithMissingValueSupport

        defineOptions, getMissingValue, missingValueTipText, setMissingValue
      • Methods inherited from class adams.data.io.input.AbstractSpreadSheetReader

        canDecompress, check, dataRowTypeTipText, doRead, doRead, encodingTipText, getAdditionalInformation, getDataRowType, getDefaultDataRowType, getDefaultFormatExtension, getDefaultSpreadSheet, getEncoding, getLastError, getReaders, getSpreadSheetType, hasLastError, initialize, isStopped, read, read, read, read, runReader, setDataRowType, setEncoding, setLastError, setSpreadSheetType, spreadSheetTypeTipText, stopExecution, supportsCompressedInput
      • Methods inherited from class adams.core.option.AbstractOptionHandler

        cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, 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.Destroyable

        destroy
      • Methods inherited from interface adams.core.logging.LoggingLevelHandler

        getLoggingLevel
      • Methods inherited from interface adams.core.option.OptionHandler

        cleanUpOptions, getOptionManager, toCommandLine
      • Methods inherited from interface adams.data.io.input.SpreadSheetReader

        dataRowTypeTipText, getDataRowType, getDefaultFormatExtension, getLastError, getSpreadSheetType, hasLastError, isStopped, read, read, read, read, setDataRowType, setSpreadSheetType, spreadSheetTypeTipText, stopExecution
    • Constructor Detail

      • GnuplotSpreadSheetReader

        public GnuplotSpreadSheetReader()
    • 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
      • getFormatDescription

        public String getFormatDescription()
        Returns a string describing the format (used in the file chooser).
        Specified by:
        getFormatDescription in interface adams.core.io.FileFormatHandler
        Specified by:
        getFormatDescription in interface adams.data.io.input.SpreadSheetReader
        Specified by:
        getFormatDescription in class adams.data.io.input.AbstractSpreadSheetReader
        Returns:
        a description suitable for displaying in the file chooser
      • getFormatExtensions

        public String[] getFormatExtensions()
        Returns the extension(s) of the format.
        Specified by:
        getFormatExtensions in interface adams.core.io.FileFormatHandler
        Specified by:
        getFormatExtensions in interface adams.data.io.input.SpreadSheetReader
        Specified by:
        getFormatExtensions in class adams.data.io.input.AbstractSpreadSheetReader
        Returns:
        the extension (without the dot!)
      • getCorrespondingWriter

        public adams.data.io.output.SpreadSheetWriter getCorrespondingWriter()
        Returns, if available, the corresponding writer.
        Returns:
        the writer, null if none available
      • getDefaultMissingValue

        protected adams.core.base.BaseRegExp getDefaultMissingValue()
        Returns the default missing value to use.
        Overrides:
        getDefaultMissingValue in class adams.data.io.input.AbstractSpreadSheetReaderWithMissingValueSupport
        Returns:
        the default
      • getInputType

        protected adams.data.io.input.AbstractSpreadSheetReader.InputType getInputType()
        Returns how to read the data, from a file, stream or reader.
        Specified by:
        getInputType in class adams.data.io.input.AbstractSpreadSheetReader
        Returns:
        how to read the data
      • doRead

        protected adams.data.spreadsheet.SpreadSheet doRead​(File file)
        Performs the actual reading.
        Overrides:
        doRead in class adams.data.io.input.AbstractSpreadSheetReader
        Parameters:
        file - the file to read from
        Returns:
        the spreadsheet or null in case of an error
      • main

        public static void main​(String[] args)
        Runs the reader from the command-line. Use the option AbstractSpreadSheetReader.OPTION_INPUT to specify the input file. If the option AbstractSpreadSheetReader.OPTION_OUTPUT is specified then the read sheet gets output as .csv files in that directory.
        Parameters:
        args - the command-line options to use