public class CountEmitter extends PackEmitter
| Modifier and Type | Field and Description |
|---|---|
private int |
numEntries
number of entries in expanded array
|
private int |
translate
translate all values by this amount
|
chunks, name, out| Modifier | Constructor and Description |
|---|---|
protected |
CountEmitter(java.lang.String name)
Create a count/value emitter for a specific field.
|
| Modifier and Type | Method and 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.
|
private int numEntries
private int translate
protected CountEmitter(java.lang.String name)
name - name of the generated arraypublic void emitUnpack()
emitUnpack in class PackEmitterPackEmitter.emitUnpack()public void setValTranslation(int i)
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].public void emit(int count,
int value)
Automatically translates value by the translate value.
count - a int.value - a int.setValTranslation(int)