JFlex
Class CountEmitter

java.lang.Object
  extended by JFlex.PackEmitter
      extended by JFlex.CountEmitter

public class CountEmitter
extends PackEmitter

An emitter for an array encoded as count/value pairs in a string.


Field Summary
 
Fields inherited from class JFlex.PackEmitter
chunks, name, out
 
Constructor Summary
protected CountEmitter(java.lang.String name)
          Create a count/value emitter for a specific field.
 
Method Summary
 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.
 
Methods inherited from class JFlex.PackEmitter
breaks, constName, emitInit, emitUC, nl, println, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CountEmitter

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

Parameters:
name - name of the generated array
Method Detail

emitUnpack

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

Specified by:
emitUnpack in class PackEmitter
See Also:
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.

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 -
value -
See Also:
setValTranslation(int)