Package org.apache.calcite.avatica.util
Class Spacer
java.lang.Object
org.apache.calcite.avatica.util.Spacer
Efficiently writes strings of spaces.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionadd(int n) Increases the current number of spaces byn.intget()Returns the current number of spaces.Returns a string that is padded on the right with spaces to the current length.set(int n) Sets the current number of spaces.spaces(StringBuilder buf) Appends current number of spaces to aStringBuilder.subtract(int n) Reduces the current number of spaces byn.toString()Returns a string of the current number of spaces.
-
Constructor Details
-
Spacer
public Spacer()Creates a Spacer with zero spaces. -
Spacer
public Spacer(int n) Creates a Spacer with a given number of spaces.
-
-
Method Details
-
set
Sets the current number of spaces. -
get
public int get()Returns the current number of spaces. -
add
Increases the current number of spaces byn. -
subtract
Reduces the current number of spaces byn. -
toString
Returns a string of the current number of spaces. -
spaces
Appends current number of spaces to aStringBuilder. -
padRight
Returns a string that is padded on the right with spaces to the current length.
-