Package org.apache.calcite.avatica.util
Class Spaces
java.lang.Object
org.apache.calcite.avatica.util.Spaces
Utilities for creating strings of spaces.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final CharSequenceThe longest possible string of spaces. -
Method Summary
Modifier and TypeMethodDescriptionstatic PrintWriterappend(PrintWriter pw, int n) Appendsnspaces to aPrintWriter.static StringWriterappend(StringWriter pw, int n) Appendsnspaces to aStringWriter.static Appendableappend(Appendable buf, int n) Appendsnspaces to anAppendable.static StringBufferappend(StringBuffer buf, int n) Appendsnspaces to aStringBuffer.static StringBuilderappend(StringBuilder buf, int n) Appendsnspaces to aStringBuilder.static Stringof(int n) Returns a string ofnspaces.static StringReturns a string that is padded on the left with spaces to the given length.static StringReturns a string that is padded on the right with spaces to the given length.static CharSequencesequence(int n) Creates a sequence ofnspaces.
-
Field Details
-
MAX
The longest possible string of spaces. Fine as long as you don't try to print it.Use with
StringBuilder.append(CharSequence, int, int)to append spaces without doing memory allocation.
-
-
Method Details
-
sequence
Creates a sequence ofnspaces. -
of
Returns a string ofnspaces. -
append
Appendsnspaces to anAppendable.- Throws:
IOException
-
append
Appendsnspaces to aPrintWriter. -
append
Appendsnspaces to aStringWriter. -
append
Appendsnspaces to aStringBuilder. -
append
Appendsnspaces to aStringBuffer. -
padRight
Returns a string that is padded on the right with spaces to the given length. -
padLeft
Returns a string that is padded on the left with spaces to the given length.
-