ptolemy.kernel.util
Class StreamListener

java.lang.Object
  extended by ptolemy.kernel.util.StreamListener
All Implemented Interfaces:
DebugListener

public class StreamListener
extends java.lang.Object
implements DebugListener

A debug listener that sends messages to a stream or to the standard output.

Since:
Ptolemy II 0.3
Version:
$Id: StreamListener.java 57040 2010-01-27 20:52:32Z cxh $
Author:
Edward A. Lee, Christopher Hylands
See Also:
NamedObj, RecorderListener
Accepted Rating:
Green (cxh)
Proposed Rating:
Green (eal)

Field Summary
private  java.io.PrintStream _output
           
 
Constructor Summary
StreamListener()
          Create a debug listener that sends messages to the standard output.
StreamListener(java.io.OutputStream out)
          Create a debug listener that sends messages to the specified stream.
 
Method Summary
 void event(DebugEvent event)
          Print a string representation of the event to the stream associated with this listener.
 void message(java.lang.String message)
          Copy the message argument to the stream associated with the listener.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_output

private java.io.PrintStream _output
Constructor Detail

StreamListener

public StreamListener()
Create a debug listener that sends messages to the standard output.


StreamListener

public StreamListener(java.io.OutputStream out)
Create a debug listener that sends messages to the specified stream.

Parameters:
out - The output stream used to create the debug listener.
Method Detail

event

public void event(DebugEvent event)
Print a string representation of the event to the stream associated with this listener.

Specified by:
event in interface DebugListener
Parameters:
event - The event.

message

public void message(java.lang.String message)
Copy the message argument to the stream associated with the listener. Note that a newline is appended to the end of the message.

Specified by:
message in interface DebugListener
Parameters:
message - The debug message.