public static class ConverterUtils.DataSink extends Object implements Serializable, RevisionHandler
DataSource
.ConverterUtils.DataSource
,
Serialized FormConstructor and Description |
---|
DataSink(OutputStream stream)
initializes the sink to save the data in the stream (always in ARFF
format).
|
DataSink(Saver saver)
initializes the sink to save the data to the given Saver (expected to be
fully configured).
|
DataSink(String filename)
initializes the sink to save the data to the given file.
|
Modifier and Type | Method and Description |
---|---|
String |
getRevision()
Returns the revision string.
|
static void |
main(String[] args)
for testing only - takes a data file as input and a data file for the
output.
|
void |
write(Instances data)
writes the given data either via the saver or to the defined
output stream (depending on the constructor).
|
static void |
write(OutputStream stream,
Instances data)
writes the data to the given stream (always in ARFF format).
|
static void |
write(Saver saver,
Instances data)
writes the data via the given saver.
|
static void |
write(String filename,
Instances data)
writes the data to the given file.
|
public DataSink(String filename) throws Exception
filename
- the file to save data toException
- if set of saver failspublic DataSink(Saver saver)
saver
- the saver to use for saving the datapublic DataSink(OutputStream stream)
stream
- the output stream to use for storing the data in ARFF
formatpublic void write(Instances data) throws Exception
data
- the data to saveException
- if saving failspublic static void write(String filename, Instances data) throws Exception
filename
- the file to write the data todata
- the data to storeException
- if writing failspublic static void write(Saver saver, Instances data) throws Exception
saver
- the saver to use for writing the datadata
- the data to storeException
- if writing failspublic static void write(OutputStream stream, Instances data) throws Exception
stream
- the stream to write the data to (ARFF format)data
- the data to storeException
- if writing failspublic static void main(String[] args) throws Exception
args
- the commandline argumentsException
- if something goes wrongpublic String getRevision()
getRevision
in interface RevisionHandler
Copyright © 2019 University of Waikato, Hamilton, NZ. All rights reserved.