Class HuffmanParamsCalculator<T>
- java.lang.Object
-
- htsjdk.samtools.cram.encoding.core.huffmanUtils.HuffmanParamsCalculator<T>
-
- Type Parameters:
T
- type of the symbols in the alphabet being huffman-encoded
public class HuffmanParamsCalculator<T> extends Object
A utility class that calculates Huffman encoding parameters based on the frequencies of the symbols to be encoded. Note this does not generate the actual (canonical) huffman codes, it only generates non-canonical codes as intermediate step in order to determine the huffman bit code lengths, which are part of the encoding params.
-
-
Constructor Summary
Constructors Constructor Description HuffmanParamsCalculator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addSymbolObservations(T symbol, int numberOfObservations)
Record one or more observations of a given symbol in the input stream.HuffmanParams<T>
getHuffmanParams()
-
-
-
Method Detail
-
addSymbolObservations
public void addSymbolObservations(T symbol, int numberOfObservations)
Record one or more observations of a given symbol in the input stream.- Parameters:
symbol
- symbol observednumberOfObservations
- number of observations
-
getHuffmanParams
public HuffmanParams<T> getHuffmanParams()
- Returns:
- the HuffmanParams for the given alphabet
-
-