Class AbstractFileSaver

    • Constructor Detail

      • AbstractFileSaver

        public AbstractFileSaver()
    • Method Detail

      • getWriter

        public BufferedWriter getWriter()
        Gets the writer
        Returns:
        the BufferedWriter
      • resetWriter

        public void resetWriter()
        Sets the writer to null.
      • setDir

        public void setDir​(String dir)
        Sets the directory where the instances should be stored
        Specified by:
        setDir in interface Saver
        Overrides:
        setDir in class AbstractSaver
        Parameters:
        dir - a string containing the directory path and name
      • setEnvironment

        public void setEnvironment​(Environment env)
        Set the environment variables to use.
        Specified by:
        setEnvironment in interface EnvironmentHandler
        Parameters:
        env - the environment variables to use
      • listOptions

        public Enumeration<Option> listOptions()
        Returns an enumeration describing the available options.
        Specified by:
        listOptions in interface OptionHandler
        Returns:
        an enumeration of all the available options.
      • setOptions

        public void setOptions​(String[] options)
                        throws Exception
        Parses a given list of options. Valid option is:

        -i input arff file
        The input filw in arff format.

        -o the output file
        The output file. The prefix of the output file is sufficient. If no output file is given, Saver tries to use standard out.

        Specified by:
        setOptions in interface OptionHandler
        Parameters:
        options - the list of options as an array of strings
        Throws:
        Exception - if an option is not supported
      • getOptions

        public String[] getOptions()
        Gets the current settings of the Saver object.
        Specified by:
        getOptions in interface OptionHandler
        Returns:
        an array of strings suitable for passing to setOptions
      • cancel

        public void cancel()
        Cancels the incremental saving process.
        Overrides:
        cancel in class AbstractSaver
      • setDirAndPrefix

        public void setDirAndPrefix​(String relationName,
                                    String add)
        Sets the directory and the file prefix. This method is used in the KnowledgeFlow GUI
        Specified by:
        setDirAndPrefix in interface Saver
        Overrides:
        setDirAndPrefix in class AbstractSaver
        Parameters:
        relationName - the name of the relation to save
        add - additional string which should be part of the filename
      • useRelativePathTipText

        public String useRelativePathTipText()
        Tip text suitable for displaying int the GUI
        Returns:
        a description of this property as a String
      • setUseRelativePath

        public void setUseRelativePath​(boolean rp)
        Set whether to use relative rather than absolute paths
        Specified by:
        setUseRelativePath in interface FileSourcedConverter
        Parameters:
        rp - true if relative paths are to be used
      • getUseRelativePath

        public boolean getUseRelativePath()
        Gets whether relative paths are to be used
        Specified by:
        getUseRelativePath in interface FileSourcedConverter
        Returns:
        true if relative paths are to be used
      • runFileSaver

        public static void runFileSaver​(AbstractFileSaver saver,
                                        String[] options)
        runs the given saver with the specified options
        Parameters:
        saver - the saver to run
        options - the commandline options