Package org.ocpsoft.prettytime.impl
Class ResourcesTimeFormat
java.lang.Object
org.ocpsoft.prettytime.format.SimpleTimeFormat
org.ocpsoft.prettytime.impl.ResourcesTimeFormat
- All Implemented Interfaces:
LocaleAware<SimpleTimeFormat>,TimeFormat
Represents a simple method of formatting a specific
Duration of time- Author:
- lb3
-
Field Summary
Fields inherited from class org.ocpsoft.prettytime.format.SimpleTimeFormat
QUANTITY, SIGN, UNIT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionDecorate with past or future prefix/suffix (with rounding)decorateUnrounded(Duration duration, String time) Decorate with past or future prefix/suffix (without rounding)Given a populatedDurationobject.formatUnrounded(Duration duration) Given a populatedDurationobject.Set theLocalefor which this instance should behave in.Methods inherited from class org.ocpsoft.prettytime.format.SimpleTimeFormat
getGramaticallyCorrectName, getPattern, getPattern, getQuantity, isPlural, setFuturePluralName, setFuturePrefix, setFutureSingularName, setFutureSuffix, setPastPluralName, setPastPrefix, setPastSingularName, setPastSuffix, setPattern, setPluralName, setRoundingTolerance, setSingularName, toString
-
Constructor Details
-
ResourcesTimeFormat
-
ResourcesTimeFormat
-
-
Method Details
-
setLocale
Description copied from interface:LocaleAwareSet theLocalefor which this instance should behave in.- Specified by:
setLocalein interfaceLocaleAware<SimpleTimeFormat>- Overrides:
setLocalein classSimpleTimeFormat
-
decorate
Description copied from interface:TimeFormatDecorate with past or future prefix/suffix (with rounding)- Specified by:
decoratein interfaceTimeFormat- Overrides:
decoratein classSimpleTimeFormat- Parameters:
duration- The originalDurationinstance from which the time string should be decorated.time- The formatted time string.
-
decorateUnrounded
Description copied from interface:TimeFormatDecorate with past or future prefix/suffix (without rounding)- Specified by:
decorateUnroundedin interfaceTimeFormat- Overrides:
decorateUnroundedin classSimpleTimeFormat- Parameters:
duration- The originalDurationinstance from which the time string should be decorated.time- The formatted time string.
-
format
Description copied from interface:TimeFormatGiven a populatedDurationobject. Apply formatting (with rounding) and output the result.- Specified by:
formatin interfaceTimeFormat- Overrides:
formatin classSimpleTimeFormat
-
formatUnrounded
Description copied from interface:TimeFormatGiven a populatedDurationobject. Apply formatting (without rounding) and output the result.- Specified by:
formatUnroundedin interfaceTimeFormat- Overrides:
formatUnroundedin classSimpleTimeFormat
-