au.id.pbw.hyfo.hyph
Class BigTernaryTree.TernaryTreeWalker

java.lang.Object
  extended by au.id.pbw.hyfo.hyph.BigTernaryTree.TernaryTreeWalker
All Implemented Interfaces:
Runnable
Enclosing class:
BigTernaryTree

public class BigTernaryTree.TernaryTreeWalker
extends Object
implements Runnable

This process walks the tree and feeds TreeElements into a blocking queue for reading by an Iterator.


Constructor Summary
BigTernaryTree.TernaryTreeWalker(Thread consumer, ArrayBlockingQueue<TreeElement> queue)
          Constructs a new tree walker.
 
Method Summary
 int[] get_key()
          Constructs the key from the series of entries in the key codepoint stack.
 void run()
          The run method of the Runnable interface.
 void walk(int node)
          Walks the tree in in-order sequence.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BigTernaryTree.TernaryTreeWalker

public BigTernaryTree.TernaryTreeWalker(Thread consumer,
                                        ArrayBlockingQueue<TreeElement> queue)
Constructs a new tree walker.

Parameters:
consumer - the thread that consumes the output of this wlaker.
queue - the blocking queue through which tree elements are fed to the consumer.
Method Detail

run

public void run()
The run method of the Runnable interface.

Specified by:
run in interface Runnable

walk

public void walk(int node)
          throws InterruptedException
Walks the tree in in-order sequence. At each node, a new TreeElement detailing the node is appended to a queue.

Parameters:
node - the starting node.
Throws:
InterruptedException - if the method is interrupted.

get_key

public int[] get_key()
Constructs the key from the series of entries in the key codepoint stack.

Returns:
an array of codepoints representing the key.


Copyright © 2005-2006 Peter B. West.