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)
Coder
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
.public it.unimi.dsi.fastutil.booleans.BooleanIterator flush()
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
Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.