public class PrependingStringBuilder extends IndentingStringBuilder
sb| Constructor and Description |
|---|
PrependingStringBuilder(IndentingStringBuilder isb,
java.lang.String prependString)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
IndentingStringBuilder |
addComment(java.lang.String comment)
Add a c-style comment.
|
IndentingStringBuilder |
append(char v)
Append a char.
|
IndentingStringBuilder |
append(long v)
Append a long value, as text.
|
IndentingStringBuilder |
append(java.lang.String v)
Append a String.
|
int |
length()
Return the length of the String written so far.
|
IndentingStringBuilder |
nextLine()
Emit a newline, along with any necessary indentation.
|
IndentingStringBuilder |
popIndent()
Remove a level of indentation.
|
IndentingStringBuilder |
pushIndent()
Add a new level of indentation.
|
java.lang.String |
toString() |
boolean |
triggered()
Determine whether or not the prepender has fired.
|
public PrependingStringBuilder(IndentingStringBuilder isb, java.lang.String prependString)
isb - the IndentingStringBuilder to write toprependString - the string to prependpublic java.lang.String toString()
toString in class IndentingStringBuilderpublic int length()
IndentingStringBuilderlength in class IndentingStringBuilderpublic boolean triggered()
public IndentingStringBuilder append(java.lang.String v)
IndentingStringBuilderappend in class IndentingStringBuilderv - the string to appendpublic IndentingStringBuilder append(char v)
IndentingStringBuilderappend in class IndentingStringBuilderv - the char to appendpublic IndentingStringBuilder append(long v)
IndentingStringBuilderappend in class IndentingStringBuilderv - the long to appendpublic IndentingStringBuilder nextLine()
IndentingStringBuildernextLine in class IndentingStringBuilderpublic IndentingStringBuilder pushIndent()
IndentingStringBuilderIndentingStringBuilder.nextLine().pushIndent in class IndentingStringBuilderpublic IndentingStringBuilder popIndent()
IndentingStringBuilderIndentingStringBuilder.nextLine().
It is an error to unindent when there are no levels of indentation active;
this is indicated with a call to IndentingStringBuilder.addComment(String) with a warning
that the caller has unindented too much.popIndent in class IndentingStringBuilderpublic IndentingStringBuilder addComment(java.lang.String comment)
IndentingStringBuilderaddComment in class IndentingStringBuildercomment - the comment