Class Spacing


  • public class Spacing
    extends java.lang.Object
    Class Spacing manages the indentation information for pretty printing.

    Class maintains a state, and is not supposed to be run in parallel threads (on the same generated class).

    • Field Summary

      Fields 
      Modifier and Type Field Description
      int indentLevel
      The indentation level
      java.lang.String spc
      The indentation string
    • Constructor Summary

      Constructors 
      Constructor Description
      Spacing​(int aIndentAmt)
      Constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String toString()
      Returns the indentation string corresponding to the indentation amount and level.
      void updateSpc​(int numIndentLvls)
      Updates the indentation.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • spc

        public java.lang.String spc
        The indentation string
      • indentLevel

        public int indentLevel
        The indentation level
    • Constructor Detail

      • Spacing

        public Spacing​(int aIndentAmt)
        Constructor.
        Parameters:
        aIndentAmt - - the indentation amount
    • Method Detail

      • toString

        public java.lang.String toString()
        Returns the indentation string corresponding to the indentation amount and level.
        Overrides:
        toString in class java.lang.Object
      • updateSpc

        public void updateSpc​(int numIndentLvls)
        Updates the indentation.
        Parameters:
        numIndentLvls - - the (positive or negative) indentation level delta.