public class Huff extends java.lang.Object implements None, PostMortem
Constructor and Description |
---|
Huff(int domain)
Construct a Huffman encoder/decoder.
|
Modifier and Type | Method and Description |
---|---|
void |
generate()
Generate the encoding/decoding table.
|
boolean |
postMortem(PostMortem pm)
Compare two Huffman tables.
|
int |
read(BitReader bitreader)
Read bits until a symbol can be identified.
|
void |
tick(int value)
Increase by 1 the weight associated with a value.
|
void |
tick(int from,
int to)
Increase by 1 the weight associated with a range of values.
|
void |
write(int value,
BitWriter bitwriter)
Write the bits corresponding to a symbol.
|
public Huff(int domain)
domain
- The number of values known to the object.public void generate()
public boolean postMortem(PostMortem pm)
postMortem
in interface PostMortem
pm
- Another object of the same type.public int read(BitReader bitreader) throws JSONException
bitreader
- The source of bits.JSONException
public void tick(int value)
value
- The number of the symbol to tickpublic void tick(int from, int to)
from
- The first symbol to tickto
- The last symbol to tickpublic void write(int value, BitWriter bitwriter) throws JSONException
value
- The number of the symbol to writebitwriter
- The destination of the bits.JSONException
Copyright © 2014. All Rights Reserved.