Methods Summary |
---|
protected void | checkWrite()Check if an indent needs to be written before writing the next
character.
The indent generation is optimized (and made consistent with
certain coding conventions) by condensing groups of eight spaces
into tab characters.
if (beginningOfLine) {
beginningOfLine = false;
int i = currentIndent;
while (i >= 8) {
super.write('\t");
i -= 8;
}
while (i > 0) {
super.write(' ");
--i;
}
}
|
protected void | indentIn()Increase the current indent by the indent step.
currentIndent += indentStep;
|
protected void | indentOut()Decrease the current indent by the indent step.
currentIndent -= indentStep;
if (currentIndent < 0)
currentIndent = 0;
|
public void | newLine()Write a line separator. The next character written will be
preceded by an indent.
super.newLine();
beginningOfLine = true;
|
public void | p(java.lang.String s)Write string.
write(s);
|
public void | pI()Indent in.
indentIn();
|
public void | pO()Indent out.
indentOut();
|
public void | pO(java.lang.String s)Indent out; write string.
pO();
p(s);
|
public void | pOln(java.lang.String s)Indent out; write string; end current line.
pO(s);
pln();
|
public void | pOlnI(java.lang.String s)Indent out; write string; end current line; indent in.
This method is useful for generating lines of code that both
end and begin nested blocks, like "} else {".
pO(s);
pln();
pI();
|
public void | pln()End current line.
newLine();
|
public void | pln(java.lang.String s)Write string; end current line.
p(s);
pln();
|
public void | plnI(java.lang.String s)Write string; end current line; indent in.
p(s);
pln();
pI();
|
public void | write(int c)Write a single character.
checkWrite();
super.write(c);
|
public void | write(char[] cbuf, int off, int len)Write a portion of an array of characters.
if (len > 0) {
checkWrite();
}
super.write(cbuf, off, len);
|
public void | write(java.lang.String s, int off, int len)Write a portion of a String.
if (len > 0) {
checkWrite();
}
super.write(s, off, len);
|