public interface RelativeTimeProvider extends UnitPatternProvider
This SPI-interface enables the access to localized
unit patterns and is instantiated via a ServiceLoader-mechanism.
If there is no external RelativeTimeProvider then Time4J will use
an internal implementation which just offers unit patterns either in
english or in scientific notation.
Note: This interface enhances the standard UnitPatternProvider by
new methods for short/abbreviated relative times and extra words for
"yesterday-today-tomorrow".
ServiceLoader| Modifier and Type | Method and Description |
|---|---|
String |
getShortDayPattern(Locale lang,
boolean future,
PluralCategory category)
Yields the localized unit pattern with short unit name and a placeholder
"{0}" for the count of days in the past or future.
|
String |
getShortHourPattern(Locale lang,
boolean future,
PluralCategory category)
Yields the localized unit pattern with short unit name and a placeholder
"{0}" for the count of hours in the past or future.
|
String |
getShortMinutePattern(Locale lang,
boolean future,
PluralCategory category)
Yields the localized unit pattern with short unit name and a placeholder
"{0}" for the count of minutes in the past or future.
|
String |
getShortMonthPattern(Locale lang,
boolean future,
PluralCategory category)
Yields the localized unit pattern with short unit name and a placeholder
"{0}" for the count of months in the past or future.
|
String |
getShortSecondPattern(Locale lang,
boolean future,
PluralCategory category)
Yields the localized unit pattern with short unit name and a placeholder
"{0}" for the count of seconds in the past or future.
|
String |
getShortWeekPattern(Locale lang,
boolean future,
PluralCategory category)
Yields the localized unit pattern with short unit name and a placeholder
"{0}" for the count of weeks in the past or future.
|
String |
getShortYearPattern(Locale lang,
boolean future,
PluralCategory category)
Yields the localized unit pattern with short unit name and a placeholder
"{0}" for the count of years in the past or future.
|
String |
getTodayWord(Locale lang)
Yields the localized word for "today".
|
String |
getTomorrowWord(Locale lang)
Yields the localized word for "tomorrow".
|
String |
getYesterdayWord(Locale lang)
Yields the localized word for "yesterday".
|
getDayPattern, getDayPattern, getHourPattern, getHourPattern, getListPattern, getMicroPattern, getMilliPattern, getMinutePattern, getMinutePattern, getMonthPattern, getMonthPattern, getNanoPattern, getNowWord, getSecondPattern, getSecondPattern, getWeekPattern, getWeekPattern, getYearPattern, getYearPatternString getShortYearPattern(Locale lang, boolean future, PluralCategory category)
Yields the localized unit pattern with short 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 getShortMonthPattern(Locale lang, boolean future, PluralCategory category)
Yields the localized unit pattern with short 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 getShortWeekPattern(Locale lang, boolean future, PluralCategory category)
Yields the localized unit pattern with short 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 getShortDayPattern(Locale lang, boolean future, PluralCategory category)
Yields the localized unit pattern with short 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 getShortHourPattern(Locale lang, boolean future, PluralCategory category)
Yields the localized unit pattern with short 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 getShortMinutePattern(Locale lang, boolean future, PluralCategory category)
Yields the localized unit pattern with short 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 getShortSecondPattern(Locale lang, boolean future, PluralCategory category)
Yields the localized unit pattern with short 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 getYesterdayWord(Locale lang)
Yields the localized word for "yesterday".
lang - language settingMissingResourceException - if not foundString getTodayWord(Locale lang)
Yields the localized word for "today".
lang - language settingMissingResourceException - if not foundString getTomorrowWord(Locale lang)
Yields the localized word for "tomorrow".
lang - language settingMissingResourceException - if not foundCopyright © 2014–2015. All rights reserved.