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.
ServiceLoader| Modifier and Type | Method and Description |
|---|---|
String |
getDayPattern(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.
|
String |
getDayPattern(Locale lang,
TextWidth width,
PluralCategory category)
Yields the localized unit pattern with unit name and a placeholder
"{0}" for the count of days.
|
String |
getHourPattern(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.
|
String |
getHourPattern(Locale lang,
TextWidth width,
PluralCategory category)
Yields the localized unit pattern with unit name and a placeholder
"{0}" for the count of hours.
|
String |
getListPattern(Locale lang,
TextWidth width,
int size)
Constructs a localized list pattern suitable for the use in
MessageFormat.format(String, Object[]). |
String |
getMicroPattern(Locale lang,
TextWidth width,
PluralCategory category)
Yields the localized unit pattern with unit name and a placeholder
"{0}" for the count of microseconds.
|
String |
getMilliPattern(Locale lang,
TextWidth width,
PluralCategory category)
Yields the localized unit pattern with unit name and a placeholder
"{0}" for the count of milliseconds.
|
String |
getMinutePattern(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.
|
String |
getMinutePattern(Locale lang,
TextWidth width,
PluralCategory category)
Yields the localized unit pattern with unit name and a placeholder
"{0}" for the count of minutes.
|
String |
getMonthPattern(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.
|
String |
getMonthPattern(Locale lang,
TextWidth width,
PluralCategory category)
Yields the localized unit pattern with unit name and a placeholder
"{0}" for the count of months.
|
String |
getNanoPattern(Locale lang,
TextWidth width,
PluralCategory category)
Yields the localized unit pattern with unit name and a placeholder
"{0}" for the count of nanoseconds.
|
String |
getNowWord(Locale lang)
Yields the localized word for the current time (now).
|
String |
getSecondPattern(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.
|
String |
getSecondPattern(Locale lang,
TextWidth width,
PluralCategory category)
Yields the localized unit pattern with unit name and a placeholder
"{0}" for the count of seconds.
|
String |
getWeekPattern(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.
|
String |
getWeekPattern(Locale lang,
TextWidth width,
PluralCategory category)
Yields the localized unit pattern with unit name and a placeholder
"{0}" for the count of weeks.
|
String |
getYearPattern(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.
|
String |
getYearPattern(Locale lang,
TextWidth width,
PluralCategory category)
Yields the localized unit pattern with unit name and a placeholder
"{0}" for the count of years.
|
String getYearPattern(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 categoryMissingResourceException - if no pattern was foundString getMonthPattern(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 categoryMissingResourceException - if no pattern was foundString getWeekPattern(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 categoryMissingResourceException - if no pattern was foundString getDayPattern(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 categoryMissingResourceException - if no pattern was foundString getHourPattern(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 categoryMissingResourceException - if no pattern was foundString getMinutePattern(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 categoryMissingResourceException - if no pattern was foundString getSecondPattern(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 categoryMissingResourceException - if no pattern was foundString getMilliPattern(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 categoryMissingResourceException - if no pattern was foundString getMicroPattern(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 categoryMissingResourceException - if no pattern was foundString getNanoPattern(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 categoryMissingResourceException - if no pattern was foundString getYearPattern(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 categoryMissingResourceException - if no pattern was foundString getMonthPattern(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 categoryMissingResourceException - if no pattern was foundString getWeekPattern(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 categoryMissingResourceException - if no pattern was foundString getDayPattern(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 categoryMissingResourceException - if no pattern was foundString getHourPattern(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 categoryMissingResourceException - if no pattern was foundString getMinutePattern(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 categoryMissingResourceException - if no pattern was foundString getSecondPattern(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 categoryMissingResourceException - if no pattern was foundString getNowWord(Locale lang)
Yields the localized word for the current time (now).
lang - language settingMissingResourceException - if not foundString getListPattern(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 itemsIllegalArgumentException - if size is smaller than 2MissingResourceException - if no pattern was foundCopyright © 2014–2015. All rights reserved.