public class CsvSampleWriter extends AbstractSampleWriter
This class handles csv header writing with the writeHeader
method. This method has to be called by user for the header to be written.
writer| Constructor and Description |
|---|
CsvSampleWriter(java.io.File output,
SampleMetadata metadata)
Constructor for a CsvSampleWriter.
|
CsvSampleWriter(java.io.OutputStream output,
SampleMetadata metadata)
Constructor for a CsvSampleWriter.
|
CsvSampleWriter(SampleMetadata metadata)
Constructor for a CsvSampleWriter.
|
CsvSampleWriter(java.io.Writer output,
SampleMetadata metadata)
Constructor for a CsvSampleWriter.
|
| Modifier and Type | Method and Description |
|---|---|
void |
setSeparator(char separator)
Set the char to use for separation of data in a line.
|
void |
setWriter(java.io.Writer writer)
Set the new writer on which samples will be written by this sample writer.
|
long |
write(Sample sample)
Write a sample to the underlying destination
|
void |
writeHeader()
Write the csv header.
|
close, setOutputFile, setOutputStreampublic CsvSampleWriter(SampleMetadata metadata)
metadata - the description for data that this writer will write. (
metadata must not be null.)public CsvSampleWriter(java.io.Writer output,
SampleMetadata metadata)
output - the writer to write data to. (Must not be null)metadata - the description for data that this writer will write. (
metadata must not be null.)public CsvSampleWriter(java.io.OutputStream output,
SampleMetadata metadata)
output - the output stream to write data to. (Must not be null)metadata - the description for data that this writer will write. (
metadata must not be null.)public CsvSampleWriter(java.io.File output,
SampleMetadata metadata)
output - the output file to write data to. (Must not be null)metadata - the description for data that this writer will write. (
metadata must not be null.)public void setSeparator(char separator)
separator - to usepublic void setWriter(java.io.Writer writer)
AbstractSampleWritersetWriter in class AbstractSampleWriterwriter - The destination writer where samples will be written by this
sample writerpublic void writeHeader()
public long write(Sample sample)
SampleWriterwrite in class SampleWritersample - The sample to be written (Must not be null)Copyright © 1998-2018 Apache Software Foundation. All Rights Reserved.