up
Class TreePrinter

java.lang.Object
  extended by up.DefaultTreeHandler
      extended by up.TreePrinter
All Implemented Interfaces:
TreeHandler

public class TreePrinter
extends DefaultTreeHandler

A tree handler that prints the trees in a stream.


Constructor Summary
TreePrinter()
          Constructs a new printer that prints trees to the standard output stream.
TreePrinter(java.io.File file)
          Constructs a new printer that prints trees to the specified file.
 
Method Summary
 void exit()
          Notifies the successor of this handler about the end of the stream.
 void next(Tree tree)
          Notifies the successor of this handler about the specified tree.
 
Methods inherited from class up.DefaultTreeHandler
getSuccessor, init, setSuccessor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TreePrinter

public TreePrinter()
Constructs a new printer that prints trees to the standard output stream.


TreePrinter

public TreePrinter(java.io.File file)
            throws java.io.IOException
Constructs a new printer that prints trees to the specified file.

Parameters:
file - the file to which to print the trees to
Throws:
java.io.IOException - if the file cannot be found
Method Detail

next

public void next(Tree tree)
Description copied from class: DefaultTreeHandler
Notifies the successor of this handler about the specified tree.

Specified by:
next in interface TreeHandler
Overrides:
next in class DefaultTreeHandler
Parameters:
tree - the tree about which the successor of this handler is to be notified

exit

public void exit()
Description copied from class: DefaultTreeHandler
Notifies the successor of this handler about the end of the stream.

Specified by:
exit in interface TreeHandler
Overrides:
exit in class DefaultTreeHandler