ptolemy.kernel.util
Class RecorderListener

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

public class RecorderListener
extends java.lang.Object
implements DebugListener

A debug listener that records messages in a string buffer.

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

Field Summary
private  java.lang.StringBuffer _buffer
           
 
Constructor Summary
RecorderListener()
          Create a listener.
 
Method Summary
 void event(DebugEvent event)
          Append a string representation of the event to the current set of messages.
 java.lang.String getMessages()
          Get the messages recorded so far.
 void message(java.lang.String message)
          Append the message to the current set of messages.
 void reset()
          Clear the buffer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_buffer

private java.lang.StringBuffer _buffer
Constructor Detail

RecorderListener

public RecorderListener()
Create a listener.

Method Detail

event

public void event(DebugEvent event)
Append a string representation of the event to the current set of messages.

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

getMessages

public java.lang.String getMessages()
Get the messages recorded so far.

Returns:
The messages recorded thus far.

message

public void message(java.lang.String message)
Append the message to the current set of messages. A newline is automatically appended to the message.

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

reset

public void reset()
Clear the buffer.