public abstract class NumberFormatProvider extends LocaleServiceProvider
NumberFormatProvider
provides localized
instances of NumberFormat
.Modifier | Constructor and Description |
---|---|
protected |
NumberFormatProvider()
Constructs a new
NumberFormatProvider . |
Modifier and Type | Method and Description |
---|---|
abstract NumberFormat |
getCurrencyInstance(Locale locale)
Returns a
NumberFormat instance
for monetary values in the specified
Locale . |
abstract NumberFormat |
getIntegerInstance(Locale locale)
Returns a
NumberFormat instance
for integers in the specified Locale . |
abstract NumberFormat |
getNumberInstance(Locale locale)
Returns a general-purpose
NumberFormat
instance in the specified Locale . |
abstract NumberFormat |
getPercentInstance(Locale locale)
Returns a
NumberFormat instance
for percentage values in the specified
Locale . |
getAvailableLocales
protected NumberFormatProvider()
NumberFormatProvider
.
Provided for implicit invocation by subclasses.public abstract NumberFormat getCurrencyInstance(Locale locale)
NumberFormat
instance
for monetary values in the specified
Locale
.locale
- the desired locale.NullPointerException
- if the locale is null.IllegalArgumentException
- if the locale is not one
returned by
LocaleServiceProvider.getAvailableLocales()
NumberFormat.getCurrencyInstance(java.util.Locale)
public abstract NumberFormat getIntegerInstance(Locale locale)
NumberFormat
instance
for integers in the specified Locale
.
The returned instance should be configured to round
floating point numbers to the nearest integer using
RoundingMode.HALF_EVEN
rounding,
and to parse only the integer part of a number.locale
- the desired locale.NullPointerException
- if the locale is null.IllegalArgumentException
- if the locale is not one
returned by
LocaleServiceProvider.getAvailableLocales()
NumberFormat.getIntegerInstance(java.util.Locale)
,
RoundingMode.HALF_EVEN
,
NumberFormat.isParseIntegerOnly()
public abstract NumberFormat getNumberInstance(Locale locale)
NumberFormat
instance in the specified Locale
.locale
- the desired locale.NullPointerException
- if the locale is null.IllegalArgumentException
- if the locale is not one
returned by
LocaleServiceProvider.getAvailableLocales()
NumberFormat.getNumberInstance(java.util.Locale)
public abstract NumberFormat getPercentInstance(Locale locale)
NumberFormat
instance
for percentage values in the specified
Locale
.locale
- the desired locale.NullPointerException
- if the locale is null.IllegalArgumentException
- if the locale is not one
returned by
LocaleServiceProvider.getAvailableLocales()
NumberFormat.getPercentInstance(java.util.Locale)