public final class HuffmanNode
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected HuffmanNode |
o0 |
protected HuffmanNode |
o1 |
protected java.lang.Integer |
value |
Modifier | Constructor and Description |
---|---|
|
HuffmanNode()
creates a new Huffman tree root node
|
protected |
HuffmanNode(HuffmanNode parent) |
protected |
HuffmanNode(HuffmanNode parent,
int value) |
Modifier and Type | Method and Description |
---|---|
protected HuffmanNode |
get0() |
protected HuffmanNode |
get1() |
protected int |
getDepth() |
protected java.lang.Integer |
getValue() |
protected int |
read(BitInputStream bis) |
boolean |
setNewValue(int depth,
int value)
creates a new tree node at the first free location at the given
depth, and assigns the value to it
|
protected HuffmanNode o0
protected HuffmanNode o1
protected java.lang.Integer value
public HuffmanNode()
protected HuffmanNode(HuffmanNode parent)
protected HuffmanNode(HuffmanNode parent, int value)
protected int read(BitInputStream bis) throws java.io.IOException
java.io.IOException
protected HuffmanNode get0()
protected HuffmanNode get1()
protected java.lang.Integer getValue()
protected int getDepth()
public boolean setNewValue(int depth, int value)
depth
- the tree depth of the new node (codeword length in bits)value
- the node's new valueCopyright © 2016 Tor-Einar Jarnbjo. All Rights Reserved.