Package elki.result.textwriter
Interface StreamFactory
-
- All Superinterfaces:
java.lang.AutoCloseable
- All Known Implementing Classes:
MultipleFilesOutput
,SingleStreamOutput
public interface StreamFactory extends java.lang.AutoCloseable
Interface for output handling (single file, multiple files, ...)Note: these classes need to be rewritten. Contributions welcome!
- Since:
- 0.2
- Author:
- Erich Schubert
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
close()
Close stream factory.void
closeStream(java.io.PrintStream stream)
Close the given output stream (Note: when writing to a single stream output, it will actually not be closed!)java.io.PrintStream
openStream(java.lang.String label)
Retrieve a print stream for output using the given label.
-
-
-
Method Detail
-
openStream
java.io.PrintStream openStream(java.lang.String label) throws java.io.IOException
Retrieve a print stream for output using the given label. Note that multiple labels MAY result in the same PrintStream, so you should be printing to only one stream at a time to avoid mixing outputs.- Parameters:
label
- Output label.- Returns:
- stream object for the given label
- Throws:
java.io.IOException
- on IO error
-
closeStream
void closeStream(java.io.PrintStream stream)
Close the given output stream (Note: when writing to a single stream output, it will actually not be closed!)- Parameters:
stream
- Stream to close
-
close
void close() throws java.io.IOException
Close stream factory.- Specified by:
close
in interfacejava.lang.AutoCloseable
- Throws:
java.io.IOException
-
-