Package net.time4j.format.expert
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 TypeMethodDescriptiondefault AttributeQuery
Returns the global format attributes which are active if they are not overridden by sectional attributes.default String
Prints given chronological entity as formatted text.default Set<ElementPosition>
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
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
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 formattedbuffer
- 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
Prints given chronological entity as formatted text and writes the text into given buffer.
- Parameters:
formattable
- object to be formattedbuffer
- text output bufferattributes
- 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
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
-