public interface UnitPatternProvider
This SPI-interface enables the access to localized
unit patterns and is instantiated via a ServiceLoader-mechanism.
If there is no external UnitPatternProvider then Time4J will use
an internal implementation which just offers unit patterns either in
english or in scientific notation.
Specification: Implementations must have a public no-arg constructor.
ServiceLoader| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getDayPattern(java.util.Locale lang,
boolean future,
PluralCategory category)
Yields the localized unit pattern with unit name and a placeholder
"{0}" for the count of days in the past or future.
|
java.lang.String |
getDayPattern(java.util.Locale lang,
TextWidth width,
PluralCategory category)
Yields the localized unit pattern with unit name and a placeholder
"{0}" for the count of days.
|
java.lang.String |
getHourPattern(java.util.Locale lang,
boolean future,
PluralCategory category)
Yields the localized unit pattern with unit name and a placeholder
"{0}" for the count of hours in the past or future.
|
java.lang.String |
getHourPattern(java.util.Locale lang,
TextWidth width,
PluralCategory category)
Yields the localized unit pattern with unit name and a placeholder
"{0}" for the count of hours.
|
java.lang.String |
getListPattern(java.util.Locale lang,
TextWidth width,
int size)
Constructs a localized list pattern suitable for the use in
MessageFormat.format(String, Object[]). |
java.lang.String |
getMicroPattern(java.util.Locale lang,
TextWidth width,
PluralCategory category)
Yields the localized unit pattern with unit name and a placeholder
"{0}" for the count of microseconds.
|
java.lang.String |
getMilliPattern(java.util.Locale lang,
TextWidth width,
PluralCategory category)
Yields the localized unit pattern with unit name and a placeholder
"{0}" for the count of milliseconds.
|
java.lang.String |
getMinutePattern(java.util.Locale lang,
boolean future,
PluralCategory category)
Yields the localized unit pattern with unit name and a placeholder
"{0}" for the count of minutes in the past or future.
|
java.lang.String |
getMinutePattern(java.util.Locale lang,
TextWidth width,
PluralCategory category)
Yields the localized unit pattern with unit name and a placeholder
"{0}" for the count of minutes.
|
java.lang.String |
getMonthPattern(java.util.Locale lang,
boolean future,
PluralCategory category)
Yields the localized unit pattern with unit name and a placeholder
"{0}" for the count of months in the past or future.
|
java.lang.String |
getMonthPattern(java.util.Locale lang,
TextWidth width,
PluralCategory category)
Yields the localized unit pattern with unit name and a placeholder
"{0}" for the count of months.
|
java.lang.String |
getNanoPattern(java.util.Locale lang,
TextWidth width,
PluralCategory category)
Yields the localized unit pattern with unit name and a placeholder
"{0}" for the count of nanoseconds.
|
java.lang.String |
getNowWord(java.util.Locale lang)
Yields the localized word for the current time (now).
|
java.lang.String |
getSecondPattern(java.util.Locale lang,
boolean future,
PluralCategory category)
Yields the localized unit pattern with unit name and a placeholder
"{0}" for the count of seconds in the past or future.
|
java.lang.String |
getSecondPattern(java.util.Locale lang,
TextWidth width,
PluralCategory category)
Yields the localized unit pattern with unit name and a placeholder
"{0}" for the count of seconds.
|
java.lang.String |
getWeekPattern(java.util.Locale lang,
boolean future,
PluralCategory category)
Yields the localized unit pattern with unit name and a placeholder
"{0}" for the count of weeks in the past or future.
|
java.lang.String |
getWeekPattern(java.util.Locale lang,
TextWidth width,
PluralCategory category)
Yields the localized unit pattern with unit name and a placeholder
"{0}" for the count of weeks.
|
java.lang.String |
getYearPattern(java.util.Locale lang,
boolean future,
PluralCategory category)
Yields the localized unit pattern with unit name and a placeholder
"{0}" for the count of years in the past or future.
|
java.lang.String |
getYearPattern(java.util.Locale lang,
TextWidth width,
PluralCategory category)
Yields the localized unit pattern with unit name and a placeholder
"{0}" for the count of years.
|
java.lang.String getYearPattern(java.util.Locale lang,
TextWidth width,
PluralCategory category)
Yields the localized unit pattern with unit name and a placeholder "{0}" for the count of years.
lang - language settingwidth - text width (ABBREVIATED as synonym for SHORT)category - plural categoryjava.util.MissingResourceException - if no pattern was foundjava.lang.String getMonthPattern(java.util.Locale lang,
TextWidth width,
PluralCategory category)
Yields the localized unit pattern with unit name and a placeholder "{0}" for the count of months.
lang - language settingwidth - text width (ABBREVIATED as synonym for SHORT)category - plural categoryjava.util.MissingResourceException - if no pattern was foundjava.lang.String getWeekPattern(java.util.Locale lang,
TextWidth width,
PluralCategory category)
Yields the localized unit pattern with unit name and a placeholder "{0}" for the count of weeks.
lang - language settingwidth - text width (ABBREVIATED as synonym for SHORT)category - plural categoryjava.util.MissingResourceException - if no pattern was foundjava.lang.String getDayPattern(java.util.Locale lang,
TextWidth width,
PluralCategory category)
Yields the localized unit pattern with unit name and a placeholder "{0}" for the count of days.
lang - language settingwidth - text width (ABBREVIATED as synonym for SHORT)category - plural categoryjava.util.MissingResourceException - if no pattern was foundjava.lang.String getHourPattern(java.util.Locale lang,
TextWidth width,
PluralCategory category)
Yields the localized unit pattern with unit name and a placeholder "{0}" for the count of hours.
lang - language settingwidth - text width (ABBREVIATED as synonym for SHORT)category - plural categoryjava.util.MissingResourceException - if no pattern was foundjava.lang.String getMinutePattern(java.util.Locale lang,
TextWidth width,
PluralCategory category)
Yields the localized unit pattern with unit name and a placeholder "{0}" for the count of minutes.
lang - language settingwidth - text width (ABBREVIATED as synonym for SHORT)category - plural categoryjava.util.MissingResourceException - if no pattern was foundjava.lang.String getSecondPattern(java.util.Locale lang,
TextWidth width,
PluralCategory category)
Yields the localized unit pattern with unit name and a placeholder "{0}" for the count of seconds.
lang - language settingwidth - text width (ABBREVIATED as synonym for SHORT)category - plural categoryjava.util.MissingResourceException - if no pattern was foundjava.lang.String getMilliPattern(java.util.Locale lang,
TextWidth width,
PluralCategory category)
Yields the localized unit pattern with unit name and a placeholder "{0}" for the count of milliseconds.
lang - language settingwidth - text width (ABBREVIATED as synonym for SHORT)category - plural categoryjava.util.MissingResourceException - if no pattern was foundjava.lang.String getMicroPattern(java.util.Locale lang,
TextWidth width,
PluralCategory category)
Yields the localized unit pattern with unit name and a placeholder "{0}" for the count of microseconds.
lang - language settingwidth - text width (ABBREVIATED as synonym for SHORT)category - plural categoryjava.util.MissingResourceException - if no pattern was foundjava.lang.String getNanoPattern(java.util.Locale lang,
TextWidth width,
PluralCategory category)
Yields the localized unit pattern with unit name and a placeholder "{0}" for the count of nanoseconds.
lang - language settingwidth - text width (ABBREVIATED as synonym for SHORT)category - plural categoryjava.util.MissingResourceException - if no pattern was foundjava.lang.String getYearPattern(java.util.Locale lang,
boolean future,
PluralCategory category)
Yields the localized unit pattern with unit name and a placeholder "{0}" for the count of years in the past or future.
lang - language settingfuture - use future or past formcategory - plural categoryjava.util.MissingResourceException - if no pattern was foundjava.lang.String getMonthPattern(java.util.Locale lang,
boolean future,
PluralCategory category)
Yields the localized unit pattern with unit name and a placeholder "{0}" for the count of months in the past or future.
lang - language settingfuture - use future or past formcategory - plural categoryjava.util.MissingResourceException - if no pattern was foundjava.lang.String getWeekPattern(java.util.Locale lang,
boolean future,
PluralCategory category)
Yields the localized unit pattern with unit name and a placeholder "{0}" for the count of weeks in the past or future.
lang - language settingfuture - use future or past formcategory - plural categoryjava.util.MissingResourceException - if no pattern was foundjava.lang.String getDayPattern(java.util.Locale lang,
boolean future,
PluralCategory category)
Yields the localized unit pattern with unit name and a placeholder "{0}" for the count of days in the past or future.
lang - language settingfuture - use future or past formcategory - plural categoryjava.util.MissingResourceException - if no pattern was foundjava.lang.String getHourPattern(java.util.Locale lang,
boolean future,
PluralCategory category)
Yields the localized unit pattern with unit name and a placeholder "{0}" for the count of hours in the past or future.
lang - language settingfuture - use future or past formcategory - plural categoryjava.util.MissingResourceException - if no pattern was foundjava.lang.String getMinutePattern(java.util.Locale lang,
boolean future,
PluralCategory category)
Yields the localized unit pattern with unit name and a placeholder "{0}" for the count of minutes in the past or future.
lang - language settingfuture - use future or past formcategory - plural categoryjava.util.MissingResourceException - if no pattern was foundjava.lang.String getSecondPattern(java.util.Locale lang,
boolean future,
PluralCategory category)
Yields the localized unit pattern with unit name and a placeholder "{0}" for the count of seconds in the past or future.
lang - language settingfuture - use future or past formcategory - plural categoryjava.util.MissingResourceException - if no pattern was foundjava.lang.String getNowWord(java.util.Locale lang)
Yields the localized word for the current time (now).
lang - language settingjava.util.MissingResourceException - if not foundjava.lang.String getListPattern(java.util.Locale lang,
TextWidth width,
int size)
Constructs a localized list pattern suitable for the use in
MessageFormat.format(String, Object[]).
lang - language settingwidth - text width (ABBREVIATED as synonym for SHORT)size - count of list itemsjava.lang.IllegalArgumentException - if size is smaller than 2java.util.MissingResourceException - if no pattern was found