Class DisplayElement<V extends Comparable<V>>
- All Implemented Interfaces:
Serializable
,Comparator<ChronoDisplay>
,ChronoElement<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 Summary
Modifier and TypeMethodDescriptiongetDisplayName(Locale language)
Obtains a localized name for display purposes if possible.Methods inherited from class net.time4j.engine.BasicElement
compare, equals, getSymbol, hashCode, isLenient, isLocal, name, toString
Methods inherited from interface net.time4j.engine.ChronoElement
getDefaultMaximum, getDefaultMinimum, getType, isDateElement, isTimeElement
Methods inherited from interface java.util.Comparator
reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Method Details
-
getDisplayName
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
andPlainDate.MONTH_AS_NUMBER
are equal.- Parameters:
language
- language setting- Returns:
- localized name or if not available then
a technical name
will be chosen
-