up
Class TreeCounter

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

public class TreeCounter
extends DefaultTreeHandler

A counter for trees.


Constructor Summary
TreeCounter()
          Constructs a new counter that reports the current count after each 1000 trees.
TreeCounter(int interval)
          Constructs a new counter.
 
Method Summary
 void exit()
          Notifies the successor of this handler about the end of the stream.
 void init()
          Notifies the successor of this handler about the start of the stream.
 void next(Tree tree)
          Notifies the successor of this handler about the specified tree.
 
Methods inherited from class up.DefaultTreeHandler
getSuccessor, setSuccessor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TreeCounter

public TreeCounter(int interval)
Constructs a new counter.

Parameters:
interval - the interval at which the current count is reported

TreeCounter

public TreeCounter()
Constructs a new counter that reports the current count after each 1000 trees.

Method Detail

init

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

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

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