|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectit.unimi.dsi.compression.CodeWordCoder
public class CodeWordCoder
A coder based on a set of codewords.
Field Summary | |
---|---|
protected BitVector[] |
codeWord
The array of codewords of this coder. |
Constructor Summary | |
---|---|
CodeWordCoder(BitVector[] codeWord)
Creates a new codeword-based coder using the given vector of codewords. |
Method Summary | |
---|---|
BitVector[] |
codeWords()
Provides access to the codewords. |
BooleanIterator |
encode(int symbol)
Encodes a symbol. |
int |
encode(int symbol,
OutputBitStream obs)
Encodes a symbol. |
BooleanIterator |
flush()
Flushes the coder. |
int |
flush(OutputBitStream unused)
Flushes the coder. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final BitVector[] codeWord
Constructor Detail |
---|
public CodeWordCoder(BitVector[] codeWord)
codeWord.length-1
, included.
codeWord
- a vector of codewords.Method Detail |
---|
public BooleanIterator encode(int symbol)
Coder
encode
in interface Coder
symbol
- a symbol.
symbol
.public int encode(int symbol, OutputBitStream obs) throws IOException
Coder
encode
in interface Coder
symbol
- a symbol.obs
- the output bit stream where the encoded symbol will be written.
IOException
public int flush(OutputBitStream unused)
Coder
flush
obs
.
flush
in interface Coder
unused
- the output bit stream where the flushing bits will be written.
public BooleanIterator flush()
Coder
flush
in interface Coder
public BitVector[] codeWords()
PrefixCoder
PrefixCoder.codeWords()
is
the first (leftmost) bit of the corresponding codeword: in other words, codewords are stored in
right-to-left fashion.
codeWords
in interface PrefixCoder
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |