public class PeriodFormat extends Object
Period formatting is performed by the PeriodFormatter
class.
Three classes provide factory methods to create formatters, and this is one.
The others are ISOPeriodFormat
and PeriodFormatterBuilder
.
PeriodFormat is thread-safe and immutable, and the formatters it returns are as well.
ISOPeriodFormat
,
PeriodFormatterBuilder
Modifier | Constructor and Description |
---|---|
protected |
PeriodFormat()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
static PeriodFormatter |
getDefault()
Gets the default formatter that outputs words in English.
|
static PeriodFormatter |
wordBased()
Returns a word based formatter for the JDK default locale.
|
static PeriodFormatter |
wordBased(Locale locale)
Returns a word based formatter for the specified locale.
|
protected PeriodFormat()
public static PeriodFormatter getDefault()
This calls wordBased(Locale)
using a locale of ENGLISH
.
public static PeriodFormatter wordBased()
This calls wordBased(Locale)
using the default locale
.
public static PeriodFormatter wordBased(Locale locale)
The words are configured in a resource bundle text file -
org.joda.time.format.messages
.
This can be added to via the normal classpath resource bundle mechanisms.
Available languages are English, Danish, Dutch, French, German, Japanese, Portuguese, and Spanish.
Copyright © 2002-2015 Joda.org. All Rights Reserved.