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".
Specification: Implementations must have a public no-arg constructor.
ServiceLoader| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getShortDayPattern(java.util.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.
|
java.lang.String |
getShortHourPattern(java.util.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.
|
java.lang.String |
getShortMinutePattern(java.util.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.
|
java.lang.String |
getShortMonthPattern(java.util.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.
|
java.lang.String |
getShortSecondPattern(java.util.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.
|
java.lang.String |
getShortWeekPattern(java.util.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.
|
java.lang.String |
getShortYearPattern(java.util.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.
|
java.lang.String |
getTodayWord(java.util.Locale lang)
Yields the localized word for "today".
|
java.lang.String |
getTomorrowWord(java.util.Locale lang)
Yields the localized word for "tomorrow".
|
java.lang.String |
getYesterdayWord(java.util.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, getYearPatternjava.lang.String getShortYearPattern(java.util.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 categoryjava.util.MissingResourceException - if no pattern was foundjava.lang.String getShortMonthPattern(java.util.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 categoryjava.util.MissingResourceException - if no pattern was foundjava.lang.String getShortWeekPattern(java.util.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 categoryjava.util.MissingResourceException - if no pattern was foundjava.lang.String getShortDayPattern(java.util.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 categoryjava.util.MissingResourceException - if no pattern was foundjava.lang.String getShortHourPattern(java.util.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 categoryjava.util.MissingResourceException - if no pattern was foundjava.lang.String getShortMinutePattern(java.util.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 categoryjava.util.MissingResourceException - if no pattern was foundjava.lang.String getShortSecondPattern(java.util.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 categoryjava.util.MissingResourceException - if no pattern was foundjava.lang.String getYesterdayWord(java.util.Locale lang)
Yields the localized word for "yesterday".
lang - language settingjava.util.MissingResourceException - if not foundjava.lang.String getTodayWord(java.util.Locale lang)
Yields the localized word for "today".
lang - language settingjava.util.MissingResourceException - if not foundjava.lang.String getTomorrowWord(java.util.Locale lang)
Yields the localized word for "tomorrow".
lang - language settingjava.util.MissingResourceException - if not found