Package com.mapr.utils
Class PlainStringBuilder
java.lang.Object
com.mapr.utils.IndentingStringBuilder
com.mapr.utils.PlainStringBuilder
Implementation of
IndentingStringBuilder that ignores formatting
commands, or only emits single whitespaces as appropriate.
Just a plain wrapper for a StringBuilder.-
Field Summary
Fields inherited from class com.mapr.utils.IndentingStringBuilder
sb -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddComment(String comment) Add a c-style comment.append(char c) Append a char.Append a String.nextLine()Emit a newline, along with any necessary indentation.Remove a level of indentation.Add a new level of indentation.Methods inherited from class com.mapr.utils.IndentingStringBuilder
append, length, toString
-
Constructor Details
-
PlainStringBuilder
Constructor.- Parameters:
sb- the StringBuilder to write to
-
-
Method Details
-
append
Description copied from class:IndentingStringBuilderAppend a String.- Overrides:
appendin classIndentingStringBuilder- Parameters:
s- the string to append- Returns:
- the IndentingStringBuilder
-
append
Description copied from class:IndentingStringBuilderAppend a char.- Overrides:
appendin classIndentingStringBuilder- Parameters:
c- the char to append- Returns:
- the IndentingStringBuilder
-
pushIndent
Description copied from class:IndentingStringBuilderAdd a new level of indentation. This has no effect until the next call toIndentingStringBuilder.nextLine().- Specified by:
pushIndentin classIndentingStringBuilder- Returns:
- this
-
popIndent
Description copied from class:IndentingStringBuilderRemove a level of indentation. This has no effect until the next call toIndentingStringBuilder.nextLine(). It is an error to unindent when there are no levels of indentation active; this is indicated with a call toIndentingStringBuilder.addComment(String)with a warning that the caller has unindented too much.- Specified by:
popIndentin classIndentingStringBuilder- Returns:
- this
-
nextLine
Description copied from class:IndentingStringBuilderEmit a newline, along with any necessary indentation.- Specified by:
nextLinein classIndentingStringBuilder- Returns:
- this
-
addComment
Description copied from class:IndentingStringBuilderAdd a c-style comment. The provided text is emitted surrounded by "/o " and " o/" (where the o's are asterisks). The comment will only appear in "pretty text." For plain text, this emits a single blank.- Specified by:
addCommentin classIndentingStringBuilder- Parameters:
comment- the comment- Returns:
-