Class FileResultsHandler

  • All Implemented Interfaces:
    adams.core.Destroyable, adams.core.GlobalInfoSupporter, adams.core.io.FileWriter, adams.core.logging.LoggingLevelHandler, adams.core.logging.LoggingSupporter, adams.core.option.OptionHandler, adams.core.SizeOfHandler, Serializable

    public class FileResultsHandler
    extends AbstractResultsHandler
    implements adams.core.io.FileWriter
    Writes the experiment results to a file.
    Version:
    $Revision$
    Author:
    FracPete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected adams.core.io.PlaceholderFile m_OutputFile
      the output file.
      protected adams.data.io.input.SpreadSheetReader m_Reader
      the spreadsheet reader to use.
      protected adams.data.io.output.SpreadSheetWriter m_Writer
      the spreadsheet writer to use.
      • 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 Concrete Methods 
      Modifier and Type Method Description
      void defineOptions()
      Adds options to the internal list of options.
      adams.core.io.PlaceholderFile getOutputFile()
      Get output file.
      adams.data.io.input.SpreadSheetReader getReader()
      Returns the spreadsheet reader to use.
      adams.data.io.output.SpreadSheetWriter getWriter()
      Returns the spreadsheet writer to use.
      String globalInfo()
      Returns a string describing the object.
      String outputFileTipText()
      Returns the tip text for this property.
      adams.data.spreadsheet.SpreadSheet read()
      Loads the results (if possible).
      String readerTipText()
      Returns the tip text for this property.
      void setOutputFile​(adams.core.io.PlaceholderFile value)
      Set output file.
      void setReader​(adams.data.io.input.SpreadSheetReader value)
      Sets the spreadsheet reader to use.
      void setWriter​(adams.data.io.output.SpreadSheetWriter value)
      Sets the spreadsheet writer to use.
      String write​(adams.data.spreadsheet.SpreadSheet results)
      Stores the results.
      String writerTipText()
      Returns the tip text for this property.
      • Methods inherited from class adams.core.option.AbstractOptionHandler

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

      • m_OutputFile

        protected adams.core.io.PlaceholderFile m_OutputFile
        the output file.
      • m_Reader

        protected adams.data.io.input.SpreadSheetReader m_Reader
        the spreadsheet reader to use.
      • m_Writer

        protected adams.data.io.output.SpreadSheetWriter m_Writer
        the spreadsheet writer to use.
    • Constructor Detail

      • FileResultsHandler

        public FileResultsHandler()
    • 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
      • 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.core.option.AbstractOptionHandler
      • setOutputFile

        public void setOutputFile​(adams.core.io.PlaceholderFile value)
        Set output file.
        Specified by:
        setOutputFile in interface adams.core.io.FileWriter
        Parameters:
        value - file
      • getOutputFile

        public adams.core.io.PlaceholderFile getOutputFile()
        Get output file.
        Specified by:
        getOutputFile in interface adams.core.io.FileWriter
        Returns:
        file
      • outputFileTipText

        public String outputFileTipText()
        Returns the tip text for this property.
        Specified by:
        outputFileTipText in interface adams.core.io.FileWriter
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setReader

        public void setReader​(adams.data.io.input.SpreadSheetReader value)
        Sets the spreadsheet reader to use.
        Parameters:
        value - file
      • getReader

        public adams.data.io.input.SpreadSheetReader getReader()
        Returns the spreadsheet reader to use.
        Returns:
        the reader
      • readerTipText

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

        public void setWriter​(adams.data.io.output.SpreadSheetWriter value)
        Sets the spreadsheet writer to use.
        Parameters:
        value - file
      • getWriter

        public adams.data.io.output.SpreadSheetWriter getWriter()
        Returns the spreadsheet writer to use.
        Returns:
        the writer
      • writerTipText

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

        public adams.data.spreadsheet.SpreadSheet read()
        Loads the results (if possible).
        Specified by:
        read in class AbstractResultsHandler
        Returns:
        the results, null if failed to obtain (or not available)
      • write

        public String write​(adams.data.spreadsheet.SpreadSheet results)
        Stores the results.
        Specified by:
        write in class AbstractResultsHandler
        Parameters:
        results - the results to store
        Returns:
        null if successful, otherwise error message