public abstract class HuffmanTree extends java.lang.Object implements java.lang.Comparable<HuffmanTree>
| Modifier and Type | Field and Description |
|---|---|
(package private) int |
frequency
An integer that contains the frequency of the character that may
be stored in a leaf node of the HuffmanTree
|
| Constructor and Description |
|---|
HuffmanTree(int frequency)
Constructor that takes a starting frequency
|
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(HuffmanTree tree)
Method required by Comparable to compare two HuffmanTrees.
|
final int frequency
HuffmanTree(int frequency)
frequency - The default starting frequency of a node (usually 0 or 1)public int compareTo(HuffmanTree tree)
compareTo in interface java.lang.Comparable<HuffmanTree>tree - The other HuffmanTree being compared