Class StreamChangeListener

  • All Implemented Interfaces:
    ChangeListener

    public class StreamChangeListener
    extends java.lang.Object
    implements ChangeListener
    A change listener that describes the changes on the standard output. It simply prints the description of the change once it executes (or throws an exception).
    Since:
    Ptolemy II 1.0
    Version:
    $Id$
    Author:
    Edward A. Lee
    Pt.AcceptedRating:
    Green (neuendor)
    Pt.ProposedRating:
    Green (eal)
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.io.PrintStream _output
      The PrintStream that we direct the output to.
    • Constructor Summary

      Constructors 
      Constructor Description
      StreamChangeListener()
      Create a change listener that sends messages to the standard output.
      StreamChangeListener​(java.io.OutputStream out)
      Create a change listener that sends messages to the specified stream.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void changeExecuted​(ChangeRequest change)
      Print the description of the change to the stream output.
      void changeFailed​(ChangeRequest change, java.lang.Exception exception)
      Print the description of the failure to the stream output.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • _output

        protected java.io.PrintStream _output
        The PrintStream that we direct the output to.
    • Constructor Detail

      • StreamChangeListener

        public StreamChangeListener()
        Create a change listener that sends messages to the standard output.
      • StreamChangeListener

        public StreamChangeListener​(java.io.OutputStream out)
        Create a change listener that sends messages to the specified stream.
        Parameters:
        out - The stream to send messages to.
    • Method Detail

      • changeExecuted

        public void changeExecuted​(ChangeRequest change)
        Print the description of the change to the stream output.
        Specified by:
        changeExecuted in interface ChangeListener
        Parameters:
        change - The change that has been executed.
      • changeFailed

        public void changeFailed​(ChangeRequest change,
                                 java.lang.Exception exception)
        Print the description of the failure to the stream output.
        Specified by:
        changeFailed in interface ChangeListener
        Parameters:
        change - The change that has been executed.
        exception - The exception that occurred.