TextStyle

Enumeration of the style of text formatting and parsing. !(p) Text styles define three sizes for the formatted text - 'full', 'short' and 'narrow'. Each of these three sizes is available _in both 'standard' and 'stand-alone' variations. !(p) The difference between the three sizes is obvious _in most languages. For example, _in English the 'full' month is 'January', the 'short' month is 'Jan' and the 'narrow' month is 'J'. Note that the narrow size is often not unique. For example, 'January', 'June' and 'July' all have the 'narrow' text 'J'. !(p) The difference between the 'standard' and 'stand-alone' forms is trickier to describe as there is no difference _in English. However, _in other languages there is a difference _in the word used when the text is used alone, as opposed to _in a complete date. For example, the word used for a month when used alone _in a date picker is different to the word used for month _in association with a day and year _in a date.

@implSpec This is immutable and thread-safe enum.

@since 1.8

Constructors

this
this(int calendarStyle, int zoneNameStyleIndex, string name, int ordinal)
Undocumented in source.

Members

Functions

asNormal
TextStyle asNormal()

Returns the normal style with the same size.

asStandalone
TextStyle asStandalone()

Returns the stand-alone style with the same size. @return the stand-alone style with the same size

isStandalone
bool isStandalone()

Returns true if the Style is a stand-alone style. @return true if the style is a stand-alone style.

toCalendarStyle
int toCalendarStyle()

Returns the {@code Calendar} style corresponding to this {@code TextStyle}.

zoneNameStyleIndex
int zoneNameStyleIndex()

Returns the relative index value to an element of the {@link java.text.DateFormatSymbols#getZoneStrings() DateFormatSymbols.getZoneStrings()} value, 0 for long names and 1 for short names (abbreviations). Note that these values do !(em)not</em> correspond to the {@link java.util.TimeZone#LONG} and {@link java.util.TimeZone#SHORT} values.

Static functions

FULL
TextStyle FULL()

Full text, typically the full description. For example, day-of-week Monday might output "Monday".

FULL_STANDALONE
TextStyle FULL_STANDALONE()

Full text for stand-alone use, typically the full description. For example, day-of-week Monday might output "Monday".

NARROW
TextStyle NARROW()

Narrow text, typically a single letter. For example, day-of-week Monday might output "M".

NARROW_STANDALONE
TextStyle NARROW_STANDALONE()

Narrow text for stand-alone use, typically a single letter. For example, day-of-week Monday might output "M".

SHORT
TextStyle SHORT()

Short text, typically an abbreviation. For example, day-of-week Monday might output "Mon".

SHORT_STANDALONE
TextStyle SHORT_STANDALONE()

Short text for stand-alone use, typically an abbreviation. For example, day-of-week Monday might output "Mon".

values
TextStyle[] values()
Undocumented in source. Be warned that the author may not have intended to support it.

Meta