|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectweka.core.converters.AbstractSaver
weka.core.converters.AbstractFileSaver
public abstract class AbstractFileSaver
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.
| Field Summary |
|---|
| Fields inherited from interface weka.core.converters.Saver |
|---|
BATCH, INCREMENTAL, NONE |
| Constructor Summary | |
|---|---|
AbstractFileSaver()
|
|
| Method Summary | |
|---|---|
void |
cancel()
Cancels the incremental saving process. |
String |
filePrefix()
Gets the file name prefix |
abstract String |
getFileDescription()
to be pverridden |
String |
getFileExtension()
Gets ihe file extension. |
String[] |
getFileExtensions()
Gets all the file extensions used for this type of file |
String[] |
getOptions()
Gets the current settings of the Saver object. |
boolean |
getUseRelativePath()
Gets whether relative paths are to be used |
BufferedWriter |
getWriter()
Gets the writer |
Enumeration |
listOptions()
Returns an enumeration describing the available options. |
void |
resetOptions()
resets the options |
void |
resetWriter()
Sets the writer to null. |
String |
retrieveDir()
Gets the directory |
File |
retrieveFile()
Gets the destination file. |
static void |
runFileSaver(AbstractFileSaver saver,
String[] options)
runs the given saver with the specified options |
void |
setDestination(File file)
Sets the destination file (and directories if necessary). |
void |
setDestination(OutputStream output)
Sets the destination output stream. |
void |
setDir(String dir)
Sets the directory where the instances should be stored |
void |
setDirAndPrefix(String relationName,
String add)
Sets the directory and the file prefix. |
void |
setEnvironment(Environment env)
Set the environment variables to use. |
void |
setFile(File outputFile)
Sets the destination file. |
void |
setFilePrefix(String prefix)
Sets the file name prefix |
void |
setOptions(String[] options)
Parses a given list of options. |
void |
setUseRelativePath(boolean rp)
Set whether to use relative rather than absolute paths |
String |
useRelativePathTipText()
Tip text suitable for displaying int the GUI |
| Methods inherited from class weka.core.converters.AbstractSaver |
|---|
getCapabilities, getInstances, getWriteMode, resetStructure, setInstances, setRetrieval, setStructure, writeBatch, writeIncremental |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface weka.core.RevisionHandler |
|---|
getRevision |
| Constructor Detail |
|---|
public AbstractFileSaver()
| Method Detail |
|---|
public void resetOptions()
resetOptions in class AbstractSaverpublic BufferedWriter getWriter()
public void resetWriter()
public String getFileExtension()
getFileExtension in interface FileSourcedConvertergetFileExtension in interface SavergetFileExtension in class AbstractSaverpublic String[] getFileExtensions()
getFileExtensions in interface FileSourcedConverterpublic File retrieveFile()
retrieveFile in interface FileSourcedConverter
public void setFile(File outputFile)
throws IOException
setFile in interface FileSourcedConvertersetFile in interface SaversetFile in class AbstractSaveroutputFile - the destination file.
IOException - throws an IOException if file cannot be setpublic void setFilePrefix(String prefix)
setFilePrefix in interface SaversetFilePrefix in class AbstractSaverprefix - the file name prefixpublic String filePrefix()
filePrefix in interface SaverfilePrefix in class AbstractSaverpublic void setDir(String dir)
setDir in interface SaversetDir in class AbstractSaverdir - a string containing the directory path and namepublic String retrieveDir()
retrieveDir in interface SaverretrieveDir in class AbstractSaverpublic void setEnvironment(Environment env)
setEnvironment in interface EnvironmentHandlerenv - the environment variables to usepublic Enumeration listOptions()
listOptions in interface OptionHandler
public void setOptions(String[] options)
throws Exception
-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 in interface OptionHandleroptions - the list of options as an array of strings
Exception - if an option is not supportedpublic String[] getOptions()
getOptions in interface OptionHandlerpublic void cancel()
cancel in class AbstractSaver
public void setDestination(File file)
throws IOException
setDestination in interface SaversetDestination in class AbstractSaverfile - the File
IOException - always
public void setDestination(OutputStream output)
throws IOException
setDestination in interface SaversetDestination in class AbstractSaveroutput - the output stream.
IOException - throws an IOException if destination cannot be set
public void setDirAndPrefix(String relationName,
String add)
setDirAndPrefix in interface SaversetDirAndPrefix in class AbstractSaverrelationName - the name of the relation to saveadd - additional string which should be part of the filenamepublic abstract String getFileDescription()
getFileDescription in interface FileSourcedConverterpublic String useRelativePathTipText()
public void setUseRelativePath(boolean rp)
setUseRelativePath in interface FileSourcedConverterrp - true if relative paths are to be usedpublic boolean getUseRelativePath()
getUseRelativePath in interface FileSourcedConverter
public static void runFileSaver(AbstractFileSaver saver,
String[] options)
saver - the saver to runoptions - the commandline options
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||