public abstract class ScalaPackEmitter extends Object
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();| Modifier and Type | Field and Description |
|---|---|
protected int |
chunks
number of existing string chunks
|
protected String |
name
name of the generated array (mixed case, no yy prefix)
|
protected StringBuilder |
out
output buffer
|
| Constructor and Description |
|---|
ScalaPackEmitter(String name)
Create new emitter for an array.
|
| Modifier and Type | Method and Description |
|---|---|
void |
breaks()
Execute line/chunk break if necessary.
|
protected String |
constName()
Convert array name into all uppercase internal scanner
constant name.
|
void |
emitEnd()
Emit declaration of decoded member.
|
void |
emitInit()
Declare, emit first chunk of encoded string.
|
void |
emitUC(int i)
Emit single unicode character.
|
abstract void |
emitUnpack()
Emit the unpacking code.
|
protected void |
nl()
emit newline
|
protected void |
println(String s) |
String |
toString()
Return current output buffer.
|
protected String name
protected StringBuilder out
protected int chunks
public ScalaPackEmitter(String name)
name - the name of the generated arrayprotected String constName()
name as a internal constant name.JavaPackEmitter.namepublic void emitInit()
public void emitEnd()
public void emitUC(int i)
i - the character to emit.public void breaks()
public abstract void emitUnpack()
protected void nl()
protected void println(String s)
Copyright © 2015. All rights reserved.