biTree.visitor
Class MakeHashTable

java.lang.Object
  |
  +--biTree.visitor.MakeHashTable
All Implemented Interfaces:
Visitor

public class MakeHashTable
extends java.lang.Object
implements Visitor

Visitor on WeightCompare to make a hashtable from a given tree.

Author:
Chad Cook

Field Summary
(package private)  java.util.Hashtable _hash
           
(package private)  int _indexToSet
           
(package private)  java.util.Vector _oneCode
           
 
Constructor Summary
MakeHashTable(java.util.Hashtable hash)
          Constructor
 
Method Summary
 void biTree(BiTree wc)
          Travels through a binary tree on all of the BiTrees
 void symbol(Symbol wc)
          When we get to a Symbol, we just want to return the value of the symbol and the code vector that we have found for that value.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

_hash

java.util.Hashtable _hash

_oneCode

java.util.Vector _oneCode

_indexToSet

int _indexToSet
Constructor Detail

MakeHashTable

public MakeHashTable(java.util.Hashtable hash)
Constructor
Parameters:
hash - The hashtable to make a tree from
Method Detail

biTree

public void biTree(BiTree wc)
Travels through a binary tree on all of the BiTrees
Specified by:
biTree in interface Visitor
Parameters:
BiTree - The tree to down which to traverse.

symbol

public void symbol(Symbol wc)
When we get to a Symbol, we just want to return the value of the symbol and the code vector that we have found for that value.
Specified by:
symbol in interface Visitor
Parameters:
Symbol - The leaf of the binary tree to which we have traversed