JFlex
Class CountEmitter
public class CountEmitter
An emitter for an array encoded as count/value pairs in a string.
CountEmitter(String name)- Create a count/value emitter for a specific field.
|
void | emit(int count, int value)- Emit one count/value pair.
|
void | emitUnpack()- Emits count/value unpacking code for the generated array.
|
void | setValTranslation(int i)- Translate all values by given amount.
|
CountEmitter
protected CountEmitter(String name)
Create a count/value emitter for a specific field.
name - name of the generated array
emit
public void emit(int count,
int value) Emit one count/value pair.
Automatically translates value by the translate value.
emitUnpack
public void emitUnpack()
Emits count/value unpacking code for the generated array.
- emitUnpack in interface PackEmitter
JFlex.PackEmitter.emitUnPack()
setValTranslation
public void setValTranslation(int i)
Translate all values by given amount.
Use to move value interval from [0, 0xFFFF] to something different.
i - amount the value will be translated by.
Example: i = 1 allows values in [-1, 0xFFFE].