Class JPAlignerBasic

java.lang.Object
com.io7m.jpita.core.JPAlignerBasic
All Implemented Interfaces:
JPAlignerType

public final class JPAlignerBasic extends Object implements JPAlignerType
An basic aligner that left-aligns text.
  • Method Details

    • create

      public static JPAlignerType create(int in_width)
      Construct a new aligner.
      Parameters:
      in_width - The maximum width in characters
      Returns:
      A new aligner
    • addWord

      public void addWord(String w)
      Description copied from interface: JPAlignerType
      Add a word to the current layout.
      Specified by:
      addWord in interface JPAlignerType
      Parameters:
      w - A word
    • breakLine

      public void breakLine()
      Description copied from interface: JPAlignerType
      Insert a hard line break.
      Specified by:
      breakLine in interface JPAlignerType
    • finish

      public List<String> finish()
      Description copied from interface: JPAlignerType
      Finish the current layout, effectively resetting it to a blank canvas.
      Specified by:
      finish in interface JPAlignerType
      Returns:
      A list of formatted lines