de.lmu.ifi.dbs.elki.result.textwriter
Class SingleStreamOutput

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.result.textwriter.SingleStreamOutput
All Implemented Interfaces:
StreamFactory

public class SingleStreamOutput
extends Object
implements StreamFactory

Class to output all result data to a single stream (e.g. Stdout, single file)


Field Summary
private  PrintStream stream
          Output stream
 
Constructor Summary
SingleStreamOutput()
          Constructor using stdout.
SingleStreamOutput(boolean gzip)
          Constructor using stdout
SingleStreamOutput(File out)
          Constructor with given file name.
SingleStreamOutput(File out, boolean gzip)
          Constructor with given file name.
SingleStreamOutput(FileDescriptor out)
          Constructor with given FileDescriptor
SingleStreamOutput(FileDescriptor out, boolean gzip)
          Constructor with given FileDescriptor
SingleStreamOutput(FileOutputStream out)
          Constructor with given FileOutputStream.
SingleStreamOutput(FileOutputStream out, boolean gzip)
          Constructor with given FileOutputStream.
 
Method Summary
 void closeAllStreams()
          Close output stream.
 PrintStream openStream(String filename)
          Return the objects shared print stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

stream

private PrintStream stream
Output stream

Constructor Detail

SingleStreamOutput

public SingleStreamOutput()
                   throws IOException
Constructor using stdout.

Throws:
IOException - on IO error

SingleStreamOutput

public SingleStreamOutput(boolean gzip)
                   throws IOException
Constructor using stdout

Parameters:
gzip - Use gzip compression
Throws:
IOException - on IO error

SingleStreamOutput

public SingleStreamOutput(File out)
                   throws IOException
Constructor with given file name.

Parameters:
out - filename
Throws:
IOException - on IO error

SingleStreamOutput

public SingleStreamOutput(File out,
                          boolean gzip)
                   throws IOException
Constructor with given file name.

Parameters:
out - filename
gzip - Use gzip compression
Throws:
IOException - on IO error

SingleStreamOutput

public SingleStreamOutput(FileDescriptor out)
                   throws IOException
Constructor with given FileDescriptor

Parameters:
out - file descriptor
Throws:
IOException - on IO error

SingleStreamOutput

public SingleStreamOutput(FileDescriptor out,
                          boolean gzip)
                   throws IOException
Constructor with given FileDescriptor

Parameters:
out - file descriptor
gzip - Use gzip compression
Throws:
IOException - on IO error

SingleStreamOutput

public SingleStreamOutput(FileOutputStream out)
                   throws IOException
Constructor with given FileOutputStream.

Parameters:
out - File output stream
Throws:
IOException - on IO error

SingleStreamOutput

public SingleStreamOutput(FileOutputStream out,
                          boolean gzip)
                   throws IOException
Constructor with given FileOutputStream.

Parameters:
out - File output stream
gzip - Use gzip compression
Throws:
IOException - on IO error
Method Detail

openStream

public PrintStream openStream(String filename)
Return the objects shared print stream.

Specified by:
openStream in interface StreamFactory
Parameters:
filename - ignored filename for SingleStreamOutput, as the name suggests
Returns:
stream object for the given label

closeAllStreams

public void closeAllStreams()
Close output stream.

Specified by:
closeAllStreams in interface StreamFactory

Release 0.4.0 (2011-09-20_1324)