public interface Saver extends Serializable, RevisionHandler
Modifier and Type | Field and Description |
---|---|
static int |
BATCH |
static int |
INCREMENTAL |
static int |
NONE
The retrieval modes
|
Modifier and Type | Method and Description |
---|---|
String |
filePrefix()
Gets the file prefix
This method is used in the KnowledgeFlow GUI.
|
String |
getFileExtension()
Gets the file extension
|
int |
getWriteMode()
Gets the write mode
|
String |
retrieveDir()
Gets the driectory of the output file
This method is used in the KnowledgeFlow GUI.
|
void |
setDestination(File file)
Resets the Saver object and sets the destination to be
the supplied File object.
|
void |
setDestination(OutputStream output)
Resets the Saver object and sets the destination to be
the supplied InputStream.
|
void |
setDir(String dir)
Sets the directory of the output file.
|
void |
setDirAndPrefix(String relationName,
String add)
Sets the file prefix and the directory.
|
void |
setFile(File file)
Sets the output file
|
void |
setFilePrefix(String prefix)
Sets the file prefix.
|
void |
setInstances(Instances instances)
Sets the instances to be saved
|
void |
setRetrieval(int mode)
Sets the retrieval mode
|
void |
writeBatch()
Writes to a destination in batch mode
|
void |
writeIncremental(Instance inst)
Writes to a destination in incremental mode.
|
getRevision
static final int NONE
static final int BATCH
static final int INCREMENTAL
void setDestination(File file) throws IOException
file
- the FileIOException
- if an error occurs
support loading from a File.
public_normal_behavior requires: file != null && (* file exists *); modifiable: model_sourceSupplied, model_structureDetermined; ensures: model_sourceSupplied == true && model_structureDetermined == false; also public_exceptional_behavior requires: file == null || (* file does not exist *); signals: (IOException);
void setDestination(OutputStream output) throws IOException
output
- the output streamIOException
- if this Loader doesn't
support loading from a File.void setRetrieval(int mode)
mode
- an integer representing a retrieval modeString getFileExtension() throws Exception
Exception
- exception if a Saver not implementing FileSourcedConverter is used.void setFile(File file) throws IOException
file
- the output fileIOException
- exception if new output file cannot be setvoid setFilePrefix(String prefix) throws Exception
prefix
- the prefix of the file nameException
- exception if a Saver not implementing FileSourcedConverter is used.String filePrefix() throws Exception
Exception
- exception if a Saver not implementing FileSourcedConverter is used.void setDir(String dir) throws IOException
dir
- a string containing the path and name of the directoryIOException
- exception if a Saver not implementing FileSourcedConverter is used.void setDirAndPrefix(String relationName, String add) throws IOException
relationName
- the name of the realtion to be savedadd
- additional String for the file nameIOException
- exception if a Saver not implementing FileSourcedConverter is used.String retrieveDir() throws IOException
IOException
- exception if a Saver not implementing FileSourcedConverter is used.void setInstances(Instances instances)
instances
- the instancesvoid writeBatch() throws IOException
IOException
- throws exection if writting in batch mode is not possiblevoid writeIncremental(Instance inst) throws IOException
inst
- the instance to write, if null the output file is closedIOException
- throws exception if incremental writting is not possibleint getWriteMode()
Copyright © 2019 University of Waikato, Hamilton, NZ. All rights reserved.