public class OneShotOutputWriter extends Object
OutputWriter
implementation writing data from a
MultiCollectable
into a step indexed file.EMPTY
Constructor and Description |
---|
OneShotOutputWriter(MultiCollectable<?> collectable,
Path outputPathBase)
Constructs a new
OneShotWritingCollector . |
Modifier and Type | Method and Description |
---|---|
protected T |
getCollectable()
Returns the
Collectable containing the data to be written. |
String |
getFileName()
Returns the name of the file where data is to be written.
|
void |
setOutputPath(Path outputPathBase)
Sets the output path base pointing to the directory where to create the
files for each shot.
|
String |
toString() |
protected void |
writeHeaders(de.zmt.output.writing.CsvWriter writer)
Write headers from collectable using the writer.
|
void |
writeValues(long steps)
Implementing classes need to specify how to write values.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
close
public OneShotOutputWriter(MultiCollectable<?> collectable, Path outputPathBase)
OneShotWritingCollector
.collectable
- the MultiCollectable
to write data fromoutputPathBase
- the base file to be used, the step number will be attached
each timepublic void writeValues(long steps) throws IOException
OutputWriter
steps
- the number of steps passed in Schedule
IOException
- If an I/O error occurspublic void setOutputPath(Path outputPathBase)
outputPathBase
- the output path baseprotected final void writeHeaders(de.zmt.output.writing.CsvWriter writer)
writer
- the writer to write the headersprotected T getCollectable()
Collectable
containing the data to be written.Collectable
containing the data to be writtenpublic String getFileName()