Package com.ibm.icu.number
Class UnlocalizedNumberFormatter
- java.lang.Object
-
- com.ibm.icu.number.NumberFormatterSettings<UnlocalizedNumberFormatter>
-
- com.ibm.icu.number.UnlocalizedNumberFormatter
-
public class UnlocalizedNumberFormatter extends NumberFormatterSettings<UnlocalizedNumberFormatter>
A NumberFormatter that does not yet have a locale. In order to format numbers, a locale must be specified. Instances of this class are immutable and thread-safe.- See Also:
NumberFormatter
-
-
Field Summary
-
Fields inherited from class com.ibm.icu.number.NumberFormatterSettings
KEY_DECIMAL, KEY_GROUPING, KEY_INTEGER, KEY_LOCALE, KEY_MACROS, KEY_MAX, KEY_NOTATION, KEY_PADDER, KEY_PER_UNIT, KEY_PRECISION, KEY_ROUNDING_MODE, KEY_SCALE, KEY_SIGN, KEY_SYMBOLS, KEY_THRESHOLD, KEY_UNIT, KEY_UNIT_DISPLAY_CASE, KEY_UNIT_WIDTH, KEY_USAGE
-
-
Constructor Summary
Constructors Constructor Description UnlocalizedNumberFormatter()
Base constructor; called during startup only.UnlocalizedNumberFormatter(NumberFormatterSettings<?> parent, int key, java.lang.Object value)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) UnlocalizedNumberFormatter
create(int key, java.lang.Object value)
LocalizedNumberFormatter
locale(ULocale locale)
ULocale version of thelocale(Locale)
setter above.LocalizedNumberFormatter
locale(java.util.Locale locale)
Associate the given locale with the number formatter.-
Methods inherited from class com.ibm.icu.number.NumberFormatterSettings
decimal, displayOptions, equals, grouping, hashCode, integerWidth, macros, notation, padding, perUnit, precision, resolve, roundingMode, scale, sign, symbols, symbols, threshold, toSkeleton, unit, unitDisplayCase, unitWidth, usage
-
-
-
-
Constructor Detail
-
UnlocalizedNumberFormatter
UnlocalizedNumberFormatter()
Base constructor; called during startup only. Sets the threshold to the default value of 3.
-
UnlocalizedNumberFormatter
UnlocalizedNumberFormatter(NumberFormatterSettings<?> parent, int key, java.lang.Object value)
-
-
Method Detail
-
locale
public LocalizedNumberFormatter locale(java.util.Locale locale)
Associate the given locale with the number formatter. The locale is used for picking the appropriate symbols, formats, and other data for number display.To use the Java default locale, call Locale.getDefault():
NumberFormatter.with(). ... .locale(Locale.getDefault())
- Parameters:
locale
- The locale to use when loading data for number formatting.- Returns:
- The fluent chain
-
locale
public LocalizedNumberFormatter locale(ULocale locale)
ULocale version of thelocale(Locale)
setter above.- Parameters:
locale
- The locale to use when loading data for number formatting.- Returns:
- The fluent chain
- See Also:
locale(Locale)
-
create
UnlocalizedNumberFormatter create(int key, java.lang.Object value)
- Specified by:
create
in classNumberFormatterSettings<UnlocalizedNumberFormatter>
-
-