Class HuffmanParams<T>

java.lang.Object
htsjdk.samtools.cram.encoding.core.huffmanUtils.HuffmanParams<T>
Type Parameters:
T - type of the symbols in the alphabet being huffman-encoded

public final class HuffmanParams<T> extends Object
A class for carrying around encoding parameters for a canonical Huffman encoder. The HuffmanParams consist of an array of symbols and an array of corresponding codeWordLengths. The actual codewords themselves are not part of the params since they can be recalculated on demand. Therefore, the params are independent of the canonicalization state (the "canonical" huffman params are the same as the non-canonical params for a given set of symbol/frequencies; it is only the code words themselves are different after canonicalization; the code word lengths are the preserved).
  • Constructor Details

    • HuffmanParams

      public HuffmanParams(List<T> symbols, List<Integer> codeWordLengths)
      Parameters:
      symbols - symbols being encoded
      codeWordLengths - code word lengths for each symbol
  • Method Details

    • getSymbols

      public List<T> getSymbols()
      Returns:
      the list of symbols for these params
    • getCodeWordLengths

      public List<Integer> getCodeWordLengths()
      Returns:
      the list of code word bit lengths for these params
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object