Class DisplayElement<V extends Comparable<V>>

java.lang.Object
net.time4j.engine.BasicElement<V>
net.time4j.format.DisplayElement<V>
All Implemented Interfaces:
Serializable, Comparator<ChronoDisplay>, ChronoElement<V>

public abstract class DisplayElement<V extends Comparable<V>> extends BasicElement<V>

Standard element which offers localized names for display purposes (in most cases).

The implementation looks up the CLDR format symbol of the element and then associate it with the suitable i18n-resources. Supported symbols are: G (era), u/y/Y (year), Q (quarter), M (month), d (day-of-month), E (weekday), h/H/k/K (hour), m (minute), s (second).

Since:
3.22/4.18
Author:
Meno Hochschild
See Also:
Serialized Form
  • Method Details

    • getDisplayName

      public String getDisplayName(Locale language)
      Description copied from interface: ChronoElement

      Obtains a localized name for display purposes if possible.

      Most elements have no localized names, but in case the i18n-module is loaded then elements like eras, years, quarters, months, weeks, day-of-month, day-of-week, am/pm, hour, minute and second do have localization support. The default implementation falls back to the technical element name.

      Note that the displayed name does not need to be unique for different elements. For example the localized names of PlainDate.MONTH_OF_YEAR and PlainDate.MONTH_AS_NUMBER are equal.

      Parameters:
      language - language setting
      Returns:
      localized name or if not available then a technical name will be chosen