Class AbstractWekaSpreadSheetWriter

  • All Implemented Interfaces:
    adams.core.AdditionalInformationHandler, adams.core.Destroyable, adams.core.GlobalInfoSupporter, adams.core.io.EncodingSupporter, adams.core.logging.LoggingLevelHandler, adams.core.logging.LoggingSupporter, adams.core.option.OptionHandler, adams.core.SizeOfHandler, adams.core.Stoppable, adams.core.StoppableWithFeedback, adams.data.io.output.SpreadSheetWriter, Serializable
    Direct Known Subclasses:
    ArffSpreadSheetWriter, JSONSpreadSheetWriter, LibSVMSpreadSheetWriter, MatlabSpreadSheetWriter, SVMLightSpreadSheetWriter, XrffSpreadSheetWriter

    public abstract class AbstractWekaSpreadSheetWriter
    extends adams.data.io.output.AbstractSpreadSheetWriter
    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.output.AbstractSpreadSheetWriter

        adams.data.io.output.AbstractSpreadSheetWriter.OutputType
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected weka.core.converters.AbstractFileSaver m_Saver
      the file loader to use.
      • Fields inherited from class adams.data.io.output.AbstractSpreadSheetWriter

        m_Encoding, m_Stopped
      • 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 boolean doWrite​(adams.data.spreadsheet.SpreadSheet content, OutputStream out)
      Performs the actual writing.
      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.output.AbstractSpreadSheetWriter.OutputType getOutputType()
      Returns how the data is written.
      protected void initialize()
      Initializes the members.
      protected abstract weka.core.converters.AbstractFileSaver newSaver()
      Returns an instance of the file loader.
      • Methods inherited from class adams.data.io.output.AbstractSpreadSheetWriter

        canCompress, doWrite, doWrite, encodingTipText, getAdditionalInformation, getDefaultFormatExtension, getEncoding, getWriters, isStopped, preWriteFile, reset, setEncoding, stopExecution, supportsCompressedOutput, write, write, write, write
      • Methods inherited from class adams.core.option.AbstractOptionHandler

        cleanUpOptions, defineOptions, destroy, 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.Destroyable

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

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

        cleanUpOptions, defineOptions, getOptionManager, toCommandLine
      • Methods inherited from interface adams.data.io.output.SpreadSheetWriter

        getCorrespondingReader
    • Field Detail

      • m_Saver

        protected weka.core.converters.AbstractFileSaver m_Saver
        the file loader to use.
    • Constructor Detail

      • AbstractWekaSpreadSheetWriter

        public AbstractWekaSpreadSheetWriter()
    • Method Detail

      • initialize

        protected void initialize()
        Initializes the members.
        Overrides:
        initialize in class adams.data.io.output.AbstractSpreadSheetWriter
      • newSaver

        protected abstract weka.core.converters.AbstractFileSaver newSaver()
        Returns an instance of the file loader.
        Returns:
        the file loader
      • getOutputType

        protected adams.data.io.output.AbstractSpreadSheetWriter.OutputType getOutputType()
        Returns how the data is written.
        Specified by:
        getOutputType in class adams.data.io.output.AbstractSpreadSheetWriter
        Returns:
        the type
      • getFormatDescription

        public String getFormatDescription()
        Returns a string describing the format (used in the file chooser).
        Specified by:
        getFormatDescription in interface adams.data.io.output.SpreadSheetWriter
        Specified by:
        getFormatDescription in class adams.data.io.output.AbstractSpreadSheetWriter
        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.data.io.output.SpreadSheetWriter
        Specified by:
        getFormatExtensions in class adams.data.io.output.AbstractSpreadSheetWriter
        Returns:
        the extension (without the dot!)
      • doWrite

        protected boolean doWrite​(adams.data.spreadsheet.SpreadSheet content,
                                  OutputStream out)
        Performs the actual writing. The caller must ensure that the output stream gets closed.
        Overrides:
        doWrite in class adams.data.io.output.AbstractSpreadSheetWriter
        Parameters:
        content - the spreadsheet to write
        out - the output stream to write the spreadsheet to
        Returns:
        true if successfully written