Package de.jarnbjo.util.io
Class HuffmanNode
java.lang.Object
de.jarnbjo.util.io.HuffmanNode
Representation of a node in a Huffman tree, used to read
Huffman compressed codewords from e.g. a Vorbis stream.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleansetNewValue(int depth, int value) creates a new tree node at the first free location at the given depth, and assigns the value to it
-
Constructor Details
-
HuffmanNode
public HuffmanNode()creates a new Huffman tree root node
-
-
Method Details
-
setNewValue
public 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- Parameters:
depth- the tree depth of the new node (codeword length in bits)value- the node's new value- Returns:
- true if successful, otherwise false
-