Package org.apache.calcite.avatica.util
Class Spacer
- java.lang.Object
-
- org.apache.calcite.avatica.util.Spacer
-
public class Spacer extends java.lang.ObjectEfficiently writes strings of spaces.
-
-
Field Summary
Fields Modifier and Type Field Description private intn
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Spaceradd(int n)Increases the current number of spaces byn.intget()Returns the current number of spaces.java.lang.StringpadRight(java.lang.String string)Returns a string that is padded on the right with spaces to the current length.Spacerset(int n)Sets the current number of spaces.java.lang.StringBuilderspaces(java.lang.StringBuilder buf)Appends current number of spaces to aStringBuilder.Spacersubtract(int n)Reduces the current number of spaces byn.java.lang.StringtoString()Returns a string of the current number of spaces.
-
-
-
Method Detail
-
set
public Spacer set(int n)
Sets the current number of spaces.
-
get
public int get()
Returns the current number of spaces.
-
add
public Spacer add(int n)
Increases the current number of spaces byn.
-
subtract
public Spacer subtract(int n)
Reduces the current number of spaces byn.
-
toString
public java.lang.String toString()
Returns a string of the current number of spaces.- Overrides:
toStringin classjava.lang.Object
-
spaces
public java.lang.StringBuilder spaces(java.lang.StringBuilder buf)
Appends current number of spaces to aStringBuilder.
-
padRight
public java.lang.String padRight(java.lang.String string)
Returns a string that is padded on the right with spaces to the current length.
-
-