Class Spacing

java.lang.Object
EDU.purdue.jtb.common.Spacing

public class Spacing extends 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
    The indentation level
    The indentation string
  • Constructor Summary

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

    Modifier and Type
    Method
    Description
    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 Details

    • spc

      public String spc
      The indentation string
    • indentLevel

      public int indentLevel
      The indentation level
  • Constructor Details

    • Spacing

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

    • toString

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

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