Class HuffmanNode

java.lang.Object
de.jarnbjo.util.io.HuffmanNode

public final class HuffmanNode extends Object
Representation of a node in a Huffman tree, used to read Huffman compressed codewords from e.g. a Vorbis stream.
  • 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