Class HuffmanBitCode<T>

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

public final class HuffmanBitCode<T> extends Object
Huffman bit code word consisting of a symbol, the corresponding codeword and codeword bit length.
  • Constructor Details

    • HuffmanBitCode

      public HuffmanBitCode(T symbol, int codeWord, int codeWordBitLength)
  • Method Details

    • getSymbol

      public T getSymbol()
      Returns:
      the symbol for this bit code
    • getCodeWord

      public int getCodeWord()
      Returns:
      the codeword for this bit code
    • getCodeWordBitLength

      public int getCodeWordBitLength()
      Returns:
      the codeword bit length for this bit code
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getBitCodeWithPrefix

      public String getBitCodeWithPrefix()
      Returns:
      the codeword for this bit code as a String, padded out to codeWordBitLength with leading zeros