Package jflex
Class CountEmitter
- java.lang.Object
-
- jflex.PackEmitter
-
- jflex.CountEmitter
-
public class CountEmitter extends PackEmitter
An emitter for an array encoded as count/value pairs in a string.- Version:
- JFlex 1.7.0
-
-
Field Summary
Fields Modifier and Type Field Description private int
numEntries
number of entries in expanded arrayprivate int
translate
translate all values by this amount-
Fields inherited from class jflex.PackEmitter
chunks, name, out
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
CountEmitter(java.lang.String name)
Create a count/value emitter for a specific field.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.
-
-
-
Method Detail
-
emitUnpack
public void emitUnpack()
Emits count/value unpacking code for the generated array.- Specified by:
emitUnpack
in classPackEmitter
- See Also:
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.
- Parameters:
i
- amount the value will be translated by. Example:i = 1
allows values in [-1, 0xFFFE].
-
emit
public void emit(int count, int value)
Emit one count/value pair.Automatically translates value by the
translate
value.- Parameters:
count
- a int.value
- a int.- See Also:
setValTranslation(int)
-
-