|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.lmu.ifi.dbs.elki.result.textwriter.MultipleFilesOutput
public class MultipleFilesOutput
Manage output to multiple files.
Field Summary | |
---|---|
private File |
basename
Base file name. |
private PrintStream |
defaultStream
Default stream to write to when no name is supplied. |
private static String |
EXTENSION
File name extension. |
private static String |
GZIP_EXTENSION
GZip extra file extension |
private static Logging |
logger
Logger for debugging. |
private HashMap<String,PrintStream> |
map
HashMap of open print streams. |
private boolean |
usegzip
Control gzip compression of output. |
Constructor Summary | |
---|---|
MultipleFilesOutput(File base)
Constructor |
|
MultipleFilesOutput(File base,
boolean gzip)
Constructor |
Method Summary | |
---|---|
void |
closeAllStreams()
Close (and forget) all output streams. |
private PrintStream |
getDefaultStream()
Retrieve/open the default output stream. |
protected boolean |
isGzipCompression()
Get GZIP compression flag. |
private PrintStream |
newStream(String name)
Open a new stream of the given name |
PrintStream |
openStream(String filename)
Retrieve the output stream for the given file name. |
protected void |
setGzipCompression(boolean usegzip)
Set GZIP compression flag. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final String EXTENSION
private static final String GZIP_EXTENSION
private PrintStream defaultStream
private File basename
private HashMap<String,PrintStream> map
private boolean usegzip
private static final Logging logger
Constructor Detail |
---|
public MultipleFilesOutput(File base)
base
- Base file name (folder name)public MultipleFilesOutput(File base, boolean gzip)
base
- Base file name (folder name)gzip
- Use gzip compression.Method Detail |
---|
private PrintStream getDefaultStream() throws IOException
IOException
private PrintStream newStream(String name) throws IOException
name
- file name (which will be appended to the base name)
IOException
public PrintStream openStream(String filename) throws IOException
openStream
in interface StreamFactory
filename
- Output label.
IOException
- on IO errorprotected boolean isGzipCompression()
protected void setGzipCompression(boolean usegzip)
usegzip
- use GZIP compressionpublic void closeAllStreams()
closeAllStreams
in interface StreamFactory
|
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |