FileDocCategorySizeDatePackage
NumberFormatProvider.javaAPI DocJava SE 6 API3804Tue Jun 10 00:25:52 BST 2008java.text.spi

NumberFormatProvider

public abstract class NumberFormatProvider extends LocaleServiceProvider
An abstract class for service providers that provide concrete implementations of the {@link java.text.NumberFormat NumberFormat} class.
since
1.6
version
@(#)NumberFormatProvider.java 1.2 05/11/17

Fields Summary
Constructors Summary
protected NumberFormatProvider()
Sole constructor. (For invocation by subclass constructors, typically implicit.)

    
Methods Summary
public abstract java.text.NumberFormatgetCurrencyInstance(java.util.Locale locale)
Returns a new NumberFormat instance which formats monetary values for the specified locale.

param
locale the desired locale.
exception
NullPointerException if locale is null
exception
IllegalArgumentException if locale isn't one of the locales returned from {@link java.util.spi.LocaleServiceProvider#getAvailableLocales() getAvailableLocales()}.
return
a currency formatter
see
java.text.NumberFormat#getCurrencyInstance(java.util.Locale)

public abstract java.text.NumberFormatgetIntegerInstance(java.util.Locale locale)
Returns a new NumberFormat instance which formats integer values for the specified locale. The returned number format is configured to round floating point numbers to the nearest integer using half-even rounding (see {@link java.math.RoundingMode#HALF_EVEN HALF_EVEN}) for formatting, and to parse only the integer part of an input string (see {@link java.text.NumberFormat#isParseIntegerOnly isParseIntegerOnly}).

param
locale the desired locale
exception
NullPointerException if locale is null
exception
IllegalArgumentException if locale isn't one of the locales returned from {@link java.util.spi.LocaleServiceProvider#getAvailableLocales() getAvailableLocales()}.
return
a number format for integer values
see
java.text.NumberFormat#getIntegerInstance(java.util.Locale)

public abstract java.text.NumberFormatgetNumberInstance(java.util.Locale locale)
Returns a new general-purpose NumberFormat instance for the specified locale.

param
locale the desired locale
exception
NullPointerException if locale is null
exception
IllegalArgumentException if locale isn't one of the locales returned from {@link java.util.spi.LocaleServiceProvider#getAvailableLocales() getAvailableLocales()}.
return
a general-purpose number formatter
see
java.text.NumberFormat#getNumberInstance(java.util.Locale)

public abstract java.text.NumberFormatgetPercentInstance(java.util.Locale locale)
Returns a new NumberFormat instance which formats percentage values for the specified locale.

param
locale the desired locale
exception
NullPointerException if locale is null
exception
IllegalArgumentException if locale isn't one of the locales returned from {@link java.util.spi.LocaleServiceProvider#getAvailableLocales() getAvailableLocales()}.
return
a percent formatter
see
java.text.NumberFormat#getPercentInstance(java.util.Locale)