Class HuffmanTreeGroup


  • final class HuffmanTreeGroup
    extends java.lang.Object
    Contains a collection of huffman trees with the same alphabet size.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private int alphabetSize
      The maximal alphabet size in this group.
      (package private) int[] codes
      Storage for Huffman lookup tables.
      (package private) int[] trees
      Offsets of distinct lookup tables in codes storage.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) static void decode​(HuffmanTreeGroup group, BitReader br)
      Decodes Huffman trees from input stream and constructs lookup tables.
      (package private) static void init​(HuffmanTreeGroup group, int alphabetSize, int n)
      Initializes the Huffman tree group.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • alphabetSize

        private int alphabetSize
        The maximal alphabet size in this group.
      • codes

        int[] codes
        Storage for Huffman lookup tables.
      • trees

        int[] trees
        Offsets of distinct lookup tables in codes storage.
    • Constructor Detail

      • HuffmanTreeGroup

        HuffmanTreeGroup()
    • Method Detail

      • init

        static void init​(HuffmanTreeGroup group,
                         int alphabetSize,
                         int n)
        Initializes the Huffman tree group.
        Parameters:
        group - POJO to be initialised
        alphabetSize - the maximal alphabet size in this group
        n - number of Huffman codes
      • decode

        static void decode​(HuffmanTreeGroup group,
                           BitReader br)
        Decodes Huffman trees from input stream and constructs lookup tables.
        Parameters:
        group - target POJO
        br - data source