## org.biojava.utils
Class ChangeListener.LoggingListener

    java.lang.Object
      org.biojava.utils.ChangeListener.LoggingListener

All Implemented Interfaces:
  ChangeListener, java.util.EventListener

Enclosing class:
  ChangeListener

public static class ChangeListener.LoggingListener
extends java.lang.Object
implements ChangeListener

A listener that writes information about the event stream to a PrintStream.

Since:
  1.1
Author:
  Matthew Pocock

Nested Class Summary

Nested classes inherited from class org.biojava.utils.ChangeListener
`ChangeListener.AlwaysVetoListener, ChangeListener.LoggingListener`

Field Summary

Fields inherited from interface org.biojava.utils.ChangeListener
`ALWAYS_VETO, LOG_TO_OUT`

Constructor Summary
`ChangeListener.LoggingListener(java.io.PrintStream out)` Create a LoggingListener that will log all events to 'out'.
`ChangeListener.LoggingListener(java.io.PrintStream out, java.lang.String prefix)` Create a LoggingListener that will log all events to 'out' with a prefix.

Method Summary
`void` `postChange(ChangeEvent cev)` Called when a change has just taken place.
`void` `preChange(ChangeEvent cev)` Called before a change takes place.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### ChangeListener.LoggingListener

    public ChangeListener.LoggingListener(java.io.PrintStream out)

  Create a LoggingListener that will log all events to 'out'.

Parameters:
  `out` - the PrintStream to log events to

### ChangeListener.LoggingListener

    public ChangeListener.LoggingListener(java.io.PrintStream out,
                                          java.lang.String prefix)

  Create a LoggingListener that will log all events to 'out' with a prefix.

Parameters:
  `out` - the PrintStream to log events to
  `prefix` - the prefix to attach to each line of the log

Method Detail

### preChange

    public void preChange(ChangeEvent cev)
                   throws ChangeVetoException

  Description copied from interface: `ChangeListener`

  Called before a change takes place.

  This is your chance to stop the change by throwing a ChangeVetoException. This method does not indicate that the change will definitely take place, so it is not recomended that you take any positive action within this handler.

  Specified by:
    `preChange` in interface `ChangeListener`
  Parameters:
    `cev` - An event encapsulating the change which is about to take place.
  Throws:
    `ChangeVetoException` - if the receiver does not wish this change to occur at this time.

### postChange

    public void postChange(ChangeEvent cev)

  Description copied from interface: `ChangeListener`

  Called when a change has just taken place.

  This method is the place to perform any behavior in response to the change event.

  Specified by:
    `postChange` in interface `ChangeListener`
  Parameters:
    `cev` - An event encapsulating the change which has occured.