weka.core.parser.JFlex
Class CountEmitter

java.lang.Object
  extended by weka.core.parser.JFlex.PackEmitter
      extended by weka.core.parser.JFlex.CountEmitter

public class CountEmitter
extends PackEmitter

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

Version:
$Revision: 1.1 $, $Date: 2008-05-09 09:14:10 $
Author:
Gerwin Klein

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 weka.core.parser.JFlex.PackEmitter
breaks, emitInit, emitUC, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

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)