public class ResourcesTimeFormat extends SimpleTimeFormat implements TimeFormat, LocaleAware<ResourcesTimeFormat>
Duration of timeQUANTITY, SIGN, UNIT| Constructor and Description |
|---|
ResourcesTimeFormat(ResourcesTimeUnit unit) |
| Modifier and Type | Method and Description |
|---|---|
String |
decorate(Duration duration,
String time)
Decorate with past or future prefix/suffix (with rounding)
|
String |
decorateUnrounded(Duration duration,
String time)
Decorate with past or future prefix/suffix (without rounding)
|
String |
format(Duration duration)
Given a populated
Duration object. |
String |
formatUnrounded(Duration duration)
Given a populated
Duration object. |
ResourcesTimeFormat |
setLocale(Locale locale)
Set the
Locale for which this instance should behave in. |
getGramaticallyCorrectName, getPattern, getPattern, getQuantity, setFuturePluralName, setFuturePrefix, setFutureSingularName, setFutureSuffix, setPastPluralName, setPastPrefix, setPastSingularName, setPastSuffix, setPattern, setPluralName, setRoundingTolerance, setSingularName, toStringpublic ResourcesTimeFormat(ResourcesTimeUnit unit)
public ResourcesTimeFormat setLocale(Locale locale)
LocaleAwareLocale for which this instance should behave in.setLocale in interface LocaleAware<ResourcesTimeFormat>public String decorate(Duration duration, String time)
TimeFormatdecorate in interface TimeFormatdecorate in class SimpleTimeFormatduration - The original Duration instance from which the time string should be decorated.time - The formatted time string.public String decorateUnrounded(Duration duration, String time)
TimeFormatdecorateUnrounded in interface TimeFormatdecorateUnrounded in class SimpleTimeFormatduration - The original Duration instance from which the time string should be decorated.time - The formatted time string.public String format(Duration duration)
TimeFormatDuration object. Apply formatting (with rounding) and output the result.format in interface TimeFormatformat in class SimpleTimeFormatpublic String formatUnrounded(Duration duration)
TimeFormatDuration object. Apply formatting (without rounding) and output the result.formatUnrounded in interface TimeFormatformatUnrounded in class SimpleTimeFormatCopyright © 2015 OCPsoft. All Rights Reserved.