|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectJFlex.PackEmitter
public abstract class PackEmitter
Encodes int
arrays as strings.
Also splits up strings when longer than 64K in UTF8 encoding.
Subclasses emit unpacking code.
Usage protocol:
p.emitInit();
for each data: p.emitData(data);
p.emitUnpack();
Field Summary | |
---|---|
protected int |
chunks
number of existing string chunks |
protected java.lang.String |
name
name of the generated array (mixed case, no yy prefix) |
protected java.lang.StringBuffer |
out
output buffer |
Constructor Summary | |
---|---|
PackEmitter(java.lang.String name)
Create new emitter for an array. |
Method Summary | |
---|---|
void |
breaks()
Execute line/chunk break if necessary. |
protected java.lang.String |
constName()
Convert array name into all uppercase internal scanner constant name. |
void |
emitInit()
Emit declaration of decoded member and open first chunk. |
void |
emitUC(int i)
Emit single unicode character. |
abstract void |
emitUnpack()
Emit the unpacking code. |
protected void |
nl()
emit newline |
protected void |
println(java.lang.String s)
|
java.lang.String |
toString()
Return current output buffer. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected java.lang.String name
protected java.lang.StringBuffer out
protected int chunks
Constructor Detail |
---|
public PackEmitter(java.lang.String name)
name
- the name of the generated arrayMethod Detail |
---|
protected java.lang.String constName()
name
as a internal constant name.name
public java.lang.String toString()
toString
in class java.lang.Object
public void emitInit()
public void emitUC(int i)
i
- the character to emit.public void breaks()
public abstract void emitUnpack()
protected void nl()
protected void println(java.lang.String s)
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |