|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectweka.core.converters.AbstractSaver
public abstract class AbstractSaver
Abstract class for Saver
Field Summary |
---|
Fields inherited from interface weka.core.converters.Saver |
---|
BATCH, INCREMENTAL, NONE |
Constructor Summary | |
---|---|
AbstractSaver()
|
Method Summary | |
---|---|
void |
cancel()
Cancels the incremental saving process if the write mode is CANCEL. |
String |
filePrefix()
Default implementation throws an IOException. |
Capabilities |
getCapabilities()
Returns the Capabilities of this saver. |
String |
getFileExtension()
Default implementation throws an IOException. |
Instances |
getInstances()
Gets instances that should be stored. |
int |
getWriteMode()
Gets the write mode. |
void |
resetOptions()
resets the options |
void |
resetStructure()
Resets the structure (header information of the instances) |
String |
retrieveDir()
Default implementation throws an IOException. |
void |
setDestination(File file)
Default implementation throws an IOException. |
void |
setDestination(OutputStream output)
Default implementation throws an IOException. |
void |
setDir(String dir)
Default implementation throws an IOException. |
void |
setDirAndPrefix(String relationName,
String add)
Default implementation throws an IOException. |
void |
setFile(File file)
Default implementation throws an IOException. |
void |
setFilePrefix(String prefix)
Default implementation throws an IOException. |
void |
setInstances(Instances instances)
Sets instances that should be stored. |
void |
setRetrieval(int mode)
Sets the retrieval mode. |
int |
setStructure(Instances headerInfo)
Sets the strcuture of the instances for the first step of incremental saving. |
abstract void |
writeBatch()
Writes to a file in batch mode To be overridden. |
void |
writeIncremental(Instance i)
Method for incremental saving. |
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 AbstractSaver()
Method Detail |
---|
public void resetOptions()
public void resetStructure()
public void setRetrieval(int mode)
setRetrieval
in interface Saver
mode
- the retrieval modepublic int getWriteMode()
getWriteMode
in interface Saver
public void setInstances(Instances instances)
setInstances
in interface Saver
instances
- the instancespublic Instances getInstances()
public void setDestination(File file) throws IOException
setDestination
in interface Saver
file
- the File
IOException
- alwayspublic void setDestination(OutputStream output) throws IOException
setDestination
in interface Saver
output
- the OutputStream
IOException
- alwayspublic Capabilities getCapabilities()
getCapabilities
in interface CapabilitiesHandler
Capabilities
public int setStructure(Instances headerInfo)
headerInfo
- an instances object.
public void cancel()
public void writeIncremental(Instance i) throws IOException
writeIncremental
in interface Saver
i
- the instance to be saved
IOException
- IOEXception if the instance acnnot be written to the specified destinationpublic abstract void writeBatch() throws IOException
writeBatch
in interface Saver
IOException
- exception if writting is not possiblepublic String getFileExtension() throws Exception
getFileExtension
in interface Saver
IOException
- always
Exception
- exception if a Saver not implementing FileSourcedConverter is used.public void setFile(File file) throws IOException
setFile
in interface Saver
file
- the File
IOException
- alwayspublic void setFilePrefix(String prefix) throws Exception
setFilePrefix
in interface Saver
prefix
- the file prefix
IOException
- always
Exception
- exception if a Saver not implementing FileSourcedConverter is used.public String filePrefix() throws Exception
filePrefix
in interface Saver
IOException
- always
Exception
- exception if a Saver not implementing FileSourcedConverter is used.public void setDir(String dir) throws IOException
setDir
in interface Saver
dir
- the name of the directory to save in
IOException
- alwayspublic void setDirAndPrefix(String relationName, String add) throws IOException
setDirAndPrefix
in interface Saver
relationName
- add
-
IOException
- alwayspublic String retrieveDir() throws IOException
retrieveDir
in interface Saver
IOException
- always
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |