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 Summary
Constructors Constructor Description HuffmanBitCode(T symbol, int codeWord, int codeWordBitLength)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getBitCodeWithPrefix()
int
getCodeWord()
int
getCodeWordBitLength()
T
getSymbol()
String
toString()
-
-
-
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
-
-