ptolemy.kernel.util
Class RecorderListener

java.lang.Object
  extended byptolemy.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,v 1.18 2004/04/13 03:44:06 cxh Exp $
Author:
Edward A. Lee, Christopher Hylands
See Also:
NamedObj, StreamListener
Accepted Rating:
Green (cxh)
Proposed Rating:
Green (eal)

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
 

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.


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.