JFlex

Class CountEmitter

public class CountEmitter extends PackEmitter

An emitter for an array encoded as count/value pairs in a string.
Constructor Summary
protected CountEmitter(String name)
Create a count/value emitter for a specific field.
Method Summary
voidemit(int count, int value)
Emit one count/value pair.
voidemitUnpack()
Emits count/value unpacking code for the generated array.
voidsetValTranslation(int i)
Translate all values by given amount.

Constructor Detail

CountEmitter

protected CountEmitter(String name)
Create a count/value emitter for a specific field.

Parameters: name name of the generated array

Method Detail

emit

public void emit(int count, int value)
Emit one count/value pair. Automatically translates value by the translate value.

Parameters: count value

See Also: CountEmitter

emitUnpack

public void emitUnpack()
Emits count/value unpacking code for the generated array.

See Also: PackEmitter

setValTranslation

public void setValTranslation(int i)
Translate all values by given amount. Use to move value interval from [0, 0xFFFF] to something different.

Parameters: i amount the value will be translated by. Example: i = 1 allows values in [-1, 0xFFFE].