Class 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 Detail

      • HuffmanBitCode

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

      • 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
      • getBitCodeWithPrefix

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