public abstract class NumberFormatProvider extends LocaleServiceProvider
NumberFormat类的具体实现的服务提供者的抽象类。
| Modifier | Constructor and Description |
|---|---|
protected |
NumberFormatProvider()
唯一的构造函数。
|
| Modifier and Type | Method and Description |
|---|---|
abstract NumberFormat |
getCurrencyInstance(Locale locale)
返回一个新的
NumberFormat实例,它为指定的区域设置格式化货币值。
|
abstract NumberFormat |
getIntegerInstance(Locale locale)
返回一个新的
NumberFormat实例,它为指定的区域设置格式化整数值。
|
abstract NumberFormat |
getNumberInstance(Locale locale)
返回指定区域设置的新通用
NumberFormat实例。
|
abstract NumberFormat |
getPercentInstance(Locale locale)
返回一个新的
NumberFormat实例,用于格式化指定区域设置的百分比值。
|
getAvailableLocales, isSupportedLocalepublic abstract NumberFormat getCurrencyInstance(Locale locale)
NumberFormat实例,它为指定的区域设置格式化货币值。
locale - 所需的语言环境。
NullPointerException - 如果
locale为空
IllegalArgumentException - 如果
locale不是从
getAvailableLocales()返回的地区之一。
NumberFormat.getCurrencyInstance(java.util.Locale)
public abstract NumberFormat getIntegerInstance(Locale locale)
NumberFormat实例,它为指定的区域设置格式化整数值。
返回的数字格式配置为使用半偶数舍入(参见HALF_EVEN )将浮点数舍入到最接近的整数,以进行格式化,并仅解析输入字符串的整数部分(参见isParseIntegerOnly )。
locale - 所需的语言环境
NullPointerException - 如果
locale为空
IllegalArgumentException - 如果
locale不是从
getAvailableLocales()返回的语言环境之一。
NumberFormat.getIntegerInstance(java.util.Locale)
public abstract NumberFormat getNumberInstance(Locale locale)
NumberFormat实例。
locale - 所需的语言环境
NullPointerException - 如果
locale为空
IllegalArgumentException - 如果
locale不是从
getAvailableLocales()返回的地区之一。
NumberFormat.getNumberInstance(java.util.Locale)
public abstract NumberFormat getPercentInstance(Locale locale)
NumberFormat实例,该实例格式化指定区域设置的百分比值。
locale - 所需的语言环境
NullPointerException - 如果
locale为空
IllegalArgumentException - 如果
locale不是从
getAvailableLocales()返回的区域设置之一。
NumberFormat.getPercentInstance(java.util.Locale)
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.