Package com.mapr.utils
Class SeparatorWriter
- java.lang.Object
-
- com.mapr.utils.SeparatorWriter
-
public class SeparatorWriter extends java.lang.ObjectAssistance for writing separators in strings. The user indicates if anything has been written and that a separator is necessary. Then, later, the user can make a request to write a separator to the string being built, and it will only be written if a previous request indicated that separator is necessary.
-
-
Constructor Summary
Constructors Constructor Description SeparatorWriter(java.lang.StringBuilder sb, java.lang.String separatorStr)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidneedSeparator()Indicate that a separator will be required the next time one is requested.voidwriteSeparator()Request to write a separator if one is necessary.
-
-
-
Method Detail
-
needSeparator
public void needSeparator()
Indicate that a separator will be required the next time one is requested. If this is not called, then calls towriteSeparator()will do nothing.
-
writeSeparator
public void writeSeparator()
Request to write a separator if one is necessary. Necessity is determined by a previous call toneedSeparator()that has not yet been fulfilled.
-
-