Class Spacer

java.lang.Object
org.apache.calcite.avatica.util.Spacer

public class Spacer extends Object
Efficiently writes strings 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

      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 by n.
    • subtract

      public Spacer subtract(int n)
      Reduces the current number of spaces by n.
    • toString

      public String toString()
      Returns a string of the current number of spaces.
      Overrides:
      toString in class Object
    • spaces

      public StringBuilder spaces(StringBuilder buf)
      Appends current number of spaces to a StringBuilder.
    • padRight

      public String padRight(String string)
      Returns a string that is padded on the right with spaces to the current length.