|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--com.colloquial.arithcode.TokenStreamEncoder
Model of a sequence of tokens. Limited to 256 distinct tokens (to enable coding as PPM).
| Field Summary | |
private ArithEncoder |
_encoder
Arithmetic encoder used for encoding symbols and the bytes making them up. |
private int[] |
_interval
Interval used for coding ranges. |
private int |
_nextTokenIndex
Index of next token, which must fall between 0 and 255 inclusive. |
private PPMModel |
_tokenBytesModel
MOdel for the bytes making up the tokens. |
private PPMModel |
_tokenSequenceModel
Model for the sequence of tokens, encoded as bytes, making up the token stream. |
private java.util.HashMap |
_tokenToSymbolMap
Maps each token string to an Integer used to encode it. |
private static java.lang.String |
LATIN1
|
private static ByteSet |
LATIN1_UNUSED_BYTES
|
| Constructor Summary | |
TokenStreamEncoder(ArithEncoder encoder,
int tokenSequenceOrder,
PPMModel tokenBytesModel)
|
|
| Method Summary | |
private void |
encode(PPMModel model,
int symbol)
|
void |
encode(java.lang.String token)
|
private void |
encodeBytes(byte[] bytes)
|
private void |
encodeToken(int symbol)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
private final ArithEncoder _encoder
private final int[] _interval
private int _nextTokenIndex
private final PPMModel _tokenBytesModel
private final PPMModel _tokenSequenceModel
private final java.util.HashMap _tokenToSymbolMap
private static final java.lang.String LATIN1
private static final ByteSet LATIN1_UNUSED_BYTES
| Constructor Detail |
public TokenStreamEncoder(ArithEncoder encoder,
int tokenSequenceOrder,
PPMModel tokenBytesModel)
| Method Detail |
public void encode(java.lang.String token)
throws java.io.IOException
java.io.IOException
private void encodeToken(int symbol)
throws java.io.IOException
java.io.IOException
private void encodeBytes(byte[] bytes)
throws java.io.IOException
java.io.IOException
private void encode(PPMModel model,
int symbol)
throws java.io.IOException
java.io.IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||