Class AbstractWekaSpreadSheetReader

  • 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.SpreadSheetReader, adams.data.spreadsheet.DataRowTypeHandler, adams.data.spreadsheet.SpreadSheetTypeHandler, Serializable
    Direct Known Subclasses:
    ArffSpreadSheetReader, JSONSpreadSheetReader, LibSVMSpreadSheetReader, MatlabSpreadSheetReader, SVMLightSpreadSheetReader, XrffSpreadSheetReader

    public abstract class AbstractWekaSpreadSheetReader
    extends adams.data.io.input.AbstractSpreadSheetReader
    Ancestor for WEKA file format readers.
    Version:
    $Revision$
    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
      protected weka.core.converters.AbstractFileLoader m_Loader
      the file loader to use.
      • 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 Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      protected adams.data.spreadsheet.SpreadSheet doRead​(File file)
      Performs the actual reading.
      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.
      protected void initialize()
      Initializes the members.
      protected abstract weka.core.converters.AbstractFileLoader newLoader()
      Returns an instance of the file loader.
      • Methods inherited from class adams.data.io.input.AbstractSpreadSheetReader

        canDecompress, check, dataRowTypeTipText, defineOptions, doRead, doRead, encodingTipText, getAdditionalInformation, getDataRowType, getDefaultDataRowType, getDefaultFormatExtension, getDefaultSpreadSheet, getEncoding, getLastError, getReaders, getSpreadSheetType, hasLastError, 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, globalInfo, 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

        getCorrespondingWriter
    • Field Detail

      • m_Loader

        protected weka.core.converters.AbstractFileLoader m_Loader
        the file loader to use.
    • Constructor Detail

      • AbstractWekaSpreadSheetReader

        public AbstractWekaSpreadSheetReader()
    • Method Detail

      • initialize

        protected void initialize()
        Initializes the members.
        Overrides:
        initialize in class adams.data.io.input.AbstractSpreadSheetReader
      • newLoader

        protected abstract weka.core.converters.AbstractFileLoader newLoader()
        Returns an instance of the file loader.
        Returns:
        the file loader
      • 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
      • 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!)
      • 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