final class TTBPDateTimePrintContext extends AnyRef
Context object used during date and time printing.
This class provides a single wrapper to items used in the print.
Specification for implementors
This class is a mutable context intended for use from a single thread. Usage of the class is thread-safe within standard printing as the framework creates a new instance of the class for each print and printing is single-threaded.
- Alphabetic
- By Inheritance
- TTBPDateTimePrintContext
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new TTBPDateTimePrintContext(temporal: TemporalAccessor, formatter: DateTimeFormatter)
Creates a new instance of the context.
Creates a new instance of the context.
- temporal
the temporal object being output, not null
- formatter
the formatter controlling the print, not null
- new TTBPDateTimePrintContext(temporal: TemporalAccessor, locale: Locale, symbols: DecimalStyle)
Value Members
- def endOptional(): Unit
Ends the printing of an optional segment of the input.
- def getLocale: Locale
Gets the locale.
Gets the locale.
This locale is used to control localization in the print output except where localization is controlled by the symbols.
- returns
the locale, not null
- def getSymbols: DecimalStyle
Gets the formatting symbols.
Gets the formatting symbols.
The symbols control the localization of numeric output.
- returns
the formatting symbols, not null
- def getTemporal: TemporalAccessor
Gets the temporal object being output.
Gets the temporal object being output.
- returns
the temporal object, not null
- def getValue(field: TemporalField): Long
Gets the value of the specified field.
Gets the value of the specified field.
This will return the value for the specified field.
- field
the field to find, not null
- returns
the value, null if not found and optional is true
- Exceptions thrown
DateTimeException
if the field is not available and the section is not optional
- def getValue[R >: Null](query: TemporalQuery[R]): R
Gets a value using a query.
Gets a value using a query.
- query
the query to use, not null
- returns
the result, null if not found and optional is true
- Exceptions thrown
DateTimeException
if the type is not available and the section is not optional
- def setDateTime(temporal: TemporalAccessor): Unit
Sets the date-time being output.
Sets the date-time being output.
- temporal
the date-time object, not null
- def setLocale(locale: Locale): Unit
Sets the locale.
Sets the locale.
This locale is used to control localization in the print output except where localization is controlled by the symbols.
- locale
the locale, not null
- def startOptional(): Unit
Starts the printing of an optional segment of the input.
- def toString(): String
Returns a string version of the context for debugging.
Returns a string version of the context for debugging.
- returns
a string representation of the context, not null
- Definition Classes
- TTBPDateTimePrintContext → AnyRef → Any