类 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.
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)
- 另请参阅:
-
字段概要
从接口继承的字段 weka.core.converters.Saver
BATCH, INCREMENTAL, NONE
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明void
cancel()
Cancels the incremental saving process.Gets the file name prefixabstract String
to be pverriddenGets ihe file extension.String[]
Gets all the file extensions used for this type of fileString[]
Gets the current settings of the Saver object.boolean
Gets whether relative paths are to be usedGets the writerReturns an enumeration describing the available options.void
resets the optionsvoid
Sets the writer to null.Gets the directoryGets the destination file.static void
runFileSaver
(AbstractFileSaver saver, String[] options) runs the given saver with the specified optionsvoid
setDestination
(File file) Sets the destination file (and directories if necessary).void
setDestination
(OutputStream output) Sets the destination output stream.void
Sets the directory where the instances should be storedvoid
setDirAndPrefix
(String relationName, String add) Sets the directory and the file prefix.void
Set the environment variables to use.void
Sets the destination file.void
setFilePrefix
(String prefix) Sets the file name prefixvoid
setOptions
(String[] options) Parses a given list of options.void
setUseRelativePath
(boolean rp) Set whether to use relative rather than absolute pathsTip text suitable for displaying int the GUI从类继承的方法 weka.core.converters.AbstractSaver
getCapabilities, getInstances, getWriteMode, resetStructure, setInstances, setRetrieval, setStructure, writeBatch, writeIncremental
从接口继承的方法 weka.core.RevisionHandler
getRevision
-
构造器详细资料
-
AbstractFileSaver
public AbstractFileSaver()
-
-
方法详细资料
-
resetOptions
public void resetOptions()resets the options- 覆盖:
resetOptions
在类中AbstractSaver
-
getWriter
Gets the writer- 返回:
- the BufferedWriter
-
resetWriter
public void resetWriter()Sets the writer to null. -
getFileExtension
Gets ihe file extension.- 指定者:
getFileExtension
在接口中FileSourcedConverter
- 指定者:
getFileExtension
在接口中Saver
- 覆盖:
getFileExtension
在类中AbstractSaver
- 返回:
- the file extension as a string.
-
getFileExtensions
Gets all the file extensions used for this type of file- 指定者:
getFileExtensions
在接口中FileSourcedConverter
- 返回:
- the file extensions
-
retrieveFile
Gets the destination file.- 指定者:
retrieveFile
在接口中FileSourcedConverter
- 返回:
- the destination file.
-
setFile
Sets the destination file.- 指定者:
setFile
在接口中FileSourcedConverter
- 指定者:
setFile
在接口中Saver
- 覆盖:
setFile
在类中AbstractSaver
- 参数:
outputFile
- the destination file.- 抛出:
IOException
- throws an IOException if file cannot be set
-
setFilePrefix
Sets the file name prefix- 指定者:
setFilePrefix
在接口中Saver
- 覆盖:
setFilePrefix
在类中AbstractSaver
- 参数:
prefix
- the file name prefix
-
filePrefix
Gets the file name prefix- 指定者:
filePrefix
在接口中Saver
- 覆盖:
filePrefix
在类中AbstractSaver
- 返回:
- the prefix of the filename
-
setDir
Sets the directory where the instances should be stored- 指定者:
setDir
在接口中Saver
- 覆盖:
setDir
在类中AbstractSaver
- 参数:
dir
- a string containing the directory path and name
-
retrieveDir
Gets the directory- 指定者:
retrieveDir
在接口中Saver
- 覆盖:
retrieveDir
在类中AbstractSaver
- 返回:
- a string with the file name
-
setEnvironment
Set the environment variables to use.- 指定者:
setEnvironment
在接口中EnvironmentHandler
- 参数:
env
- the environment variables to use
-
listOptions
Returns an enumeration describing the available options.- 指定者:
listOptions
在接口中OptionHandler
- 返回:
- an enumeration of all the available options.
-
setOptions
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
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
Sets the destination file (and directories if necessary).- 指定者:
setDestination
在接口中Saver
- 覆盖:
setDestination
在类中AbstractSaver
- 参数:
file
- the File- 抛出:
IOException
- always
-
setDestination
Sets the destination output stream.- 指定者:
setDestination
在接口中Saver
- 覆盖:
setDestination
在类中AbstractSaver
- 参数:
output
- the output stream.- 抛出:
IOException
- throws an IOException if destination cannot be set
-
setDirAndPrefix
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 saveadd
- additional string which should be part of the filename
-
getFileDescription
to be pverridden- 指定者:
getFileDescription
在接口中FileSourcedConverter
- 返回:
- the file type description.
-
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
runs the given saver with the specified options- 参数:
saver
- the saver to runoptions
- the commandline options
-