Interface ChronoPrinter<T>

Type Parameters:
T - generic type of chronological entity to be formatted
All Known Implementing Classes:
ChronoFormatter

public interface ChronoPrinter<T>

Prints a chronological entity.

Since:
3.0
Author:
Meno Hochschild
See Also:
ChronoEntity
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the global format attributes which are active if they are not overridden by sectional attributes.
    default String
    print​(T formattable)
    Prints given chronological entity as formatted text.
    print​(T formattable, StringBuilder buffer)
    Prints given chronological entity as formatted text and writes the text into given buffer.
    print​(T formattable, StringBuilder buffer, AttributeQuery attributes)
    Prints given chronological entity as formatted text and writes the text into given buffer.
  • Method Details

    • print

      default String print(T formattable)

      Prints given chronological entity as formatted text.

      Parameters:
      formattable - object to be formatted
      Returns:
      formatted text
      Throws:
      IllegalArgumentException - if given object is not formattable
      Since:
      5.0
    • print

      default Set<ElementPosition> print(T formattable, StringBuilder buffer)

      Prints given chronological entity as formatted text and writes the text into given buffer.

      Equivalent to print(formattable, buffer, getAttributes()).

      Parameters:
      formattable - object to be formatted
      buffer - text output buffer
      Returns:
      unmodifiable set of element positions in formatted text, maybe empty
      Throws:
      IllegalArgumentException - if given object is not formattable
      Since:
      4.18
    • print

      Set<ElementPosition> print(T formattable, StringBuilder buffer, AttributeQuery attributes)

      Prints given chronological entity as formatted text and writes the text into given buffer.

      Parameters:
      formattable - object to be formatted
      buffer - text output buffer
      attributes - format attributes which can control formatting
      Returns:
      unmodifiable set of element positions in formatted text, maybe empty
      Throws:
      IllegalArgumentException - if given object is not formattable
      Since:
      4.18
    • getAttributes

      default AttributeQuery getAttributes()

      Returns the global format attributes which are active if they are not overridden by sectional attributes.

      Returns:
      global control attributes valid for the whole formatter (can be overridden by sectional attributes however)
      Since:
      4.18