public final class HuffmanNode extends Object
| Modifier and Type | Field and Description |
|---|---|
protected HuffmanNode |
o0 |
protected HuffmanNode |
o1 |
protected 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 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 Integer value
public HuffmanNode()
protected HuffmanNode(HuffmanNode parent)
protected HuffmanNode(HuffmanNode parent, int value)
protected int read(BitInputStream bis) throws IOException
IOExceptionprotected HuffmanNode get0()
protected HuffmanNode get1()
protected 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 © 2017. All rights reserved.