Methods Summary |
---|
private void | _write(int indents, java.lang.String s)
final StringBuffer buffer = getBuffer();
if (!s.equals(lineSeparator))
{
for (int i = 0; i < indents; i++)
buffer.append(indent);
}
buffer.append(s);
|
private java.lang.StringBuffer | getBuffer()
if (_buffer == null)
_buffer = new StringBuffer();
return _buffer;
|
private void | indent(int indents, java.lang.String s)
if (s.indexOf(lineSeparator) != -1)
{
StringTokenizer tokenizer =
new StringTokenizer(s, lineSeparator, true);
while (tokenizer.hasMoreTokens())
write(indents, tokenizer.nextToken());
}
else
write(indents, s);
|
public java.lang.String | toString()Returns a string representation of the FormattedWriter. return getBuffer().toString();
|
void | write(int indents, java.lang.String s)
_write(indents + _initialIndents, s);
|
void | write(java.lang.String s)
_write(0, s);
|
void | writeComments(java.lang.String[] comments)
final int n = (comments != null ? comments.length : 0);
for (int i = 0; i < n; i++)
{
final String s = comments[i];
writeln("// " + (s != null ? s : "")); // NOI18N
}
|
void | writeList(int indents, java.util.List list, boolean addSeparator)
if ((list != null) && (list.size() > 0))
{
Iterator iterator = list.iterator();
while (iterator.hasNext())
{
indent(indents, iterator.next().toString());
if (addSeparator)
writeln();
}
if (!addSeparator)
writeln();
}
|
void | writeList(int indents, java.util.List list)
writeList(indents, list, false);
|
void | writeList(java.util.List list)
writeList(0, list);
|
void | writeln()
writeln(0, ""); // NOI18N
|
void | writeln(int indents, java.lang.String s)
if (_initialIndents > 0)
_write(_initialIndents, ""); // NOI18N
_write(indents, s + lineSeparator);
|
void | writeln(java.lang.String s)
writeln(0, s);
|