org.otfeed.support
Class SimpleDataWriter

java.lang.Object
  extended by org.otfeed.support.SimpleDataWriter
All Implemented Interfaces:
IDataWriter

public class SimpleDataWriter
extends java.lang.Object
implements IDataWriter

Class that writes events to a PrintWriter (defaults to terminal), using Java's toStirng() formatting.


Constructor Summary
SimpleDataWriter()
           
 
Method Summary
 void close()
          Closes stream.
 java.io.PrintWriter getPrintWriter()
          Determines the output destination.
 void setPrintWriter(java.io.PrintWriter val)
          Sets the output destination.
 void writeData(java.lang.String id, java.lang.Object data)
          Writes data out, including optional id string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleDataWriter

public SimpleDataWriter()
Method Detail

getPrintWriter

public java.io.PrintWriter getPrintWriter()
Determines the output destination. Defaults to System.out.

Returns:
destination.

setPrintWriter

public void setPrintWriter(java.io.PrintWriter val)
Sets the output destination.

Parameters:
val - destination.

writeData

public void writeData(java.lang.String id,
                      java.lang.Object data)
Description copied from interface: IDataWriter
Writes data out, including optional id string.

Specified by:
writeData in interface IDataWriter
Parameters:
id - string, identifying the quote source.
data - quote data.

close

public void close()
Description copied from interface: IDataWriter
Closes stream. If implementation uses internal buffering, its content is written out.

Specified by:
close in interface IDataWriter


Copyright © 2007 Mike Kroutikov. All Rights Reserved.