Package htsjdk.samtools.cram.encoding.core.huffmanUtils

# 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

Modifier and Type
Method
Description
`String`
`getBitCodeWithPrefix()`
`int`
`getCodeWord()`
`int`
`getCodeWordBitLength()`
`T`
`getSymbol()`
`String`
`toString()`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

## 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