Class FormatProviderImpl

java.lang.Object
eu.bandm.tools.format.FormatProviderImpl
All Implemented Interfaces:
FormatProvider<Format>

class FormatProviderImpl extends Object implements FormatProvider<Format>
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    append(List<? extends Format> elems)
    Returns a compound format object that concatenates the given elements horizontally with absolute indentation.
    beneath(List<? extends Format> elems)
    Returns a compound format object that concatenates the given elements vertically.
    beside(List<? extends Format> elems)
    Returns a compound format object that concatenates the given elements horizontally with relative indentation.
    block(List<? extends Format> elems)
    Returns a compound format object that concatenates the given elements first horizontally and then vertically.
    line(List<? extends Format> elems)
    Returns a compound format object that concatenates the given elements either horizontally or vertically.
    Returns an atomic format object that displays the given string.
    space(int width)
    Returns an atomic format object that displays breakable whitespace.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • FormatProviderImpl

      FormatProviderImpl()
  • Method Details

    • literal

      public Format literal(String text)
      Description copied from interface: FormatProvider
      Returns an atomic format object that displays the given string.

      If the given string contains whitespace, that will not be considered for line breaks.

      Specified by:
      literal in interface FormatProvider<Format>
      Parameters:
      text - the string to display
      Returns:
      an atomic format object that displays the given string
    • space

      public Format space(int width)
      Description copied from interface: FormatProvider
      Returns an atomic format object that displays breakable whitespace.
      Specified by:
      space in interface FormatProvider<Format>
      Parameters:
      width - the number of whitespace characters to display
      Returns:
      an atomic format object that displays breakable whitespace of the given width
    • append

      public Format append(List<? extends Format> elems)
      Description copied from interface: FormatProvider
      Returns a compound format object that concatenates the given elements horizontally with absolute indentation.
      Specified by:
      append in interface FormatProvider<Format>
      Parameters:
      elems - the format subobjects to concatenate
      Returns:
      a concatenated compound format object
    • beside

      public Format beside(List<? extends Format> elems)
      Description copied from interface: FormatProvider
      Returns a compound format object that concatenates the given elements horizontally with relative indentation.
      Specified by:
      beside in interface FormatProvider<Format>
      Parameters:
      elems - the format subobjects to concatenate
      Returns:
      a concatenated compound format object
    • beneath

      public Format beneath(List<? extends Format> elems)
      Description copied from interface: FormatProvider
      Returns a compound format object that concatenates the given elements vertically.
      Specified by:
      beneath in interface FormatProvider<Format>
      Parameters:
      elems - the format subobjects to concatenate
      Returns:
      a concatenated compound format object
    • line

      public Format line(List<? extends Format> elems)
      Description copied from interface: FormatProvider
      Returns a compound format object that concatenates the given elements either horizontally or vertically.
      Specified by:
      line in interface FormatProvider<Format>
      Parameters:
      elems - the format subobjects to concatenate
      Returns:
      a concatenated compound format object
    • block

      public Format block(List<? extends Format> elems)
      Description copied from interface: FormatProvider
      Returns a compound format object that concatenates the given elements first horizontally and then vertically.
      Specified by:
      block in interface FormatProvider<Format>
      Parameters:
      elems - the format subobjects to concatenate
      Returns:
      a concatenated compound format object