public class CodeWordCoder extends Object implements PrefixCoder, Serializable
| Modifier and Type | Field and Description |
|---|---|
protected BitVector[] |
codeWord
The array of codewords of this coder.
|
| Constructor and Description |
|---|
CodeWordCoder(BitVector[] codeWord)
Creates a new codeword-based coder using the given vector of codewords.
|
| Modifier and Type | Method and Description |
|---|---|
BitVector[] |
codeWords()
Provides access to the codewords.
|
it.unimi.dsi.fastutil.booleans.BooleanIterator |
encode(int symbol)
Encodes a symbol.
|
int |
encode(int symbol,
OutputBitStream obs)
Encodes a symbol.
|
it.unimi.dsi.fastutil.booleans.BooleanIterator |
flush()
Flushes the coder.
|
int |
flush(OutputBitStream unused)
Flushes the coder.
|
protected final BitVector[] codeWord
public CodeWordCoder(BitVector[] codeWord)
codeWord.length-1, included.codeWord - a vector of codewords.public it.unimi.dsi.fastutil.booleans.BooleanIterator encode(int symbol)
Coderpublic int encode(int symbol,
OutputBitStream obs)
throws IOException
Coderencode in interface Codersymbol - a symbol.obs - the output bit stream where the encoded symbol will be written.IOExceptionpublic int flush(OutputBitStream unused)
Coderflush obs.public it.unimi.dsi.fastutil.booleans.BooleanIterator flush()
Coderpublic BitVector[] codeWords()
PrefixCoderPrefixCoder.codeWords() is
the first (leftmost) bit of the corresponding codeword: in other words, codewords are stored in
right-to-left fashion.codeWords in interface PrefixCoderCopyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.