类 AbstractFileSaver

java.lang.Object
weka.core.converters.AbstractSaver
weka.core.converters.AbstractFileSaver
所有已实现的接口:
Serializable, CapabilitiesHandler, FileSourcedConverter, Saver, EnvironmentHandler, OptionHandler, RevisionHandler
直接已知子类:
ArffSaver, C45Saver, CSVSaver, LibSVMSaver, SerializedInstancesSaver, SVMLightSaver, XRFFSaver

public abstract class AbstractFileSaver extends AbstractSaver implements OptionHandler, FileSourcedConverter, EnvironmentHandler
Abstract class for Savers that save to a file Valid options are: -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.

版本:
$Revision: 9023 $
作者:
Richard Kirkby (rkirkby@cs.waikato.ac.nz), Stefan Mutter (mutter@cs.waikato.ac.nz)
另请参阅:
  • 构造器详细资料

    • AbstractFileSaver

      public AbstractFileSaver()
  • 方法详细资料

    • resetOptions

      public void resetOptions()
      resets the options
      覆盖:
      resetOptions 在类中 AbstractSaver
    • getWriter

      public BufferedWriter getWriter()
      Gets the writer
      返回:
      the BufferedWriter
    • resetWriter

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

      public String getFileExtension()
      Gets ihe file extension.
      指定者:
      getFileExtension 在接口中 FileSourcedConverter
      指定者:
      getFileExtension 在接口中 Saver
      覆盖:
      getFileExtension 在类中 AbstractSaver
      返回:
      the file extension as a string.
    • getFileExtensions

      public String[] getFileExtensions()
      Gets all the file extensions used for this type of file
      指定者:
      getFileExtensions 在接口中 FileSourcedConverter
      返回:
      the file extensions
    • retrieveFile

      public File retrieveFile()
      Gets the destination file.
      指定者:
      retrieveFile 在接口中 FileSourcedConverter
      返回:
      the destination file.
    • setFile

      public void setFile(File outputFile) throws IOException
      Sets the destination file.
      指定者:
      setFile 在接口中 FileSourcedConverter
      指定者:
      setFile 在接口中 Saver
      覆盖:
      setFile 在类中 AbstractSaver
      参数:
      outputFile - the destination file.
      抛出:
      IOException - throws an IOException if file cannot be set
    • setFilePrefix

      public void setFilePrefix(String prefix)
      Sets the file name prefix
      指定者:
      setFilePrefix 在接口中 Saver
      覆盖:
      setFilePrefix 在类中 AbstractSaver
      参数:
      prefix - the file name prefix
    • filePrefix

      public String filePrefix()
      Gets the file name prefix
      指定者:
      filePrefix 在接口中 Saver
      覆盖:
      filePrefix 在类中 AbstractSaver
      返回:
      the prefix of the filename
    • setDir

      public void setDir(String dir)
      Sets the directory where the instances should be stored
      指定者:
      setDir 在接口中 Saver
      覆盖:
      setDir 在类中 AbstractSaver
      参数:
      dir - a string containing the directory path and name
    • retrieveDir

      public String retrieveDir()
      Gets the directory
      指定者:
      retrieveDir 在接口中 Saver
      覆盖:
      retrieveDir 在类中 AbstractSaver
      返回:
      a string with the file name
    • setEnvironment

      public void setEnvironment(Environment env)
      Set the environment variables to use.
      指定者:
      setEnvironment 在接口中 EnvironmentHandler
      参数:
      env - the environment variables to use
    • listOptions

      public Enumeration listOptions()
      Returns an enumeration describing the available options.
      指定者:
      listOptions 在接口中 OptionHandler
      返回:
      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.

      指定者:
      setOptions 在接口中 OptionHandler
      参数:
      options - the list of options as an array of strings
      抛出:
      Exception - if an option is not supported
    • getOptions

      public String[] getOptions()
      Gets the current settings of the Saver object.
      指定者:
      getOptions 在接口中 OptionHandler
      返回:
      an array of strings suitable for passing to setOptions
    • cancel

      public void cancel()
      Cancels the incremental saving process.
      覆盖:
      cancel 在类中 AbstractSaver
    • setDestination

      public void setDestination(File file) throws IOException
      Sets the destination file (and directories if necessary).
      指定者:
      setDestination 在接口中 Saver
      覆盖:
      setDestination 在类中 AbstractSaver
      参数:
      file - the File
      抛出:
      IOException - always
    • setDestination

      public void setDestination(OutputStream output) throws IOException
      Sets the destination output stream.
      指定者:
      setDestination 在接口中 Saver
      覆盖:
      setDestination 在类中 AbstractSaver
      参数:
      output - the output stream.
      抛出:
      IOException - throws an IOException if destination cannot be set
    • setDirAndPrefix

      public void setDirAndPrefix(String relationName, String add)
      Sets the directory and the file prefix. This method is used in the KnowledgeFlow GUI
      指定者:
      setDirAndPrefix 在接口中 Saver
      覆盖:
      setDirAndPrefix 在类中 AbstractSaver
      参数:
      relationName - the name of the relation to save
      add - additional string which should be part of the filename
    • getFileDescription

      public abstract String getFileDescription()
      to be pverridden
      指定者:
      getFileDescription 在接口中 FileSourcedConverter
      返回:
      the file type description.
    • useRelativePathTipText

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

      public void setUseRelativePath(boolean rp)
      Set whether to use relative rather than absolute paths
      指定者:
      setUseRelativePath 在接口中 FileSourcedConverter
      参数:
      rp - true if relative paths are to be used
    • getUseRelativePath

      public boolean getUseRelativePath()
      Gets whether relative paths are to be used
      指定者:
      getUseRelativePath 在接口中 FileSourcedConverter
      返回:
      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
      参数:
      saver - the saver to run
      options - the commandline options