LEFT | RIGHT |
(no file at all) | |
1 // © 2017 and later: Unicode, Inc. and others. | 1 // © 2017 and later: Unicode, Inc. and others. |
2 // License & terms of use: http://www.unicode.org/copyright.html#License | 2 // License & terms of use: http://www.unicode.org/copyright.html#License |
3 package com.ibm.icu.number; | 3 package com.ibm.icu.number; |
4 | 4 |
5 import java.util.Locale; | 5 import java.util.Locale; |
6 | 6 |
7 import com.ibm.icu.util.ULocale; | 7 import com.ibm.icu.util.ULocale; |
8 | 8 |
9 /** | 9 /** |
10 * A NumberFormatter that does not yet have a locale. In order to format numbers
, a locale must be specified. | 10 * A NumberFormatter that does not yet have a locale. In order to format numbers
, a locale must be |
| 11 * specified. |
11 * | 12 * |
12 * @see NumberFormatter | 13 * @see NumberFormatter |
13 * @draft ICU 60 | 14 * @draft ICU 60 |
14 * @provisional This API might change or be removed in a future release. | 15 * @provisional This API might change or be removed in a future release. |
15 */ | 16 */ |
16 public class UnlocalizedNumberFormatter extends NumberFormatterSettings<Unlocali
zedNumberFormatter> { | 17 public class UnlocalizedNumberFormatter extends NumberFormatterSettings<Unlocali
zedNumberFormatter> { |
17 | 18 |
18 /** Base constructor; called during startup only. Sets the threshold to the
default value of 3. */ | 19 /** Base constructor; called during startup only. Sets the threshold to the
default value of 3. */ |
19 UnlocalizedNumberFormatter() { | 20 UnlocalizedNumberFormatter() { |
20 super(null, KEY_THRESHOLD, new Long(3)); | 21 super(null, KEY_THRESHOLD, new Long(3)); |
21 } | 22 } |
22 | 23 |
23 UnlocalizedNumberFormatter(NumberFormatterSettings<?> parent, int key, Objec
t value) { | 24 UnlocalizedNumberFormatter(NumberFormatterSettings<?> parent, int key, Objec
t value) { |
24 super(parent, key, value); | 25 super(parent, key, value); |
25 } | 26 } |
26 | 27 |
27 /** | 28 /** |
28 * Associate the given locale with the number formatter. The locale is used
for picking the appropriate symbols, | 29 * Associate the given locale with the number formatter. The locale is used
for picking the |
29 * formats, and other data for number display. | 30 * appropriate symbols, formats, and other data for number display. |
30 * | 31 * |
31 * <p> | 32 * <p> |
32 * To use the Java default locale, call Locale.getDefault(): | 33 * To use the Java default locale, call Locale.getDefault(): |
33 * | 34 * |
34 * <pre> | 35 * <pre> |
35 * NumberFormatter.with(). ... .locale(Locale.getDefault()) | 36 * NumberFormatter.with(). ... .locale(Locale.getDefault()) |
36 * </pre> | 37 * </pre> |
37 * | 38 * |
38 * @param locale | 39 * @param locale |
39 * The locale to use when loading data for number formatting. | 40 * The locale to use when loading data for number formatting. |
(...skipping 17 matching lines...) Expand all Loading... |
57 */ | 58 */ |
58 public LocalizedNumberFormatter locale(ULocale locale) { | 59 public LocalizedNumberFormatter locale(ULocale locale) { |
59 return new LocalizedNumberFormatter(this, KEY_LOCALE, locale); | 60 return new LocalizedNumberFormatter(this, KEY_LOCALE, locale); |
60 } | 61 } |
61 | 62 |
62 @Override | 63 @Override |
63 UnlocalizedNumberFormatter create(int key, Object value) { | 64 UnlocalizedNumberFormatter create(int key, Object value) { |
64 return new UnlocalizedNumberFormatter(this, key, value); | 65 return new UnlocalizedNumberFormatter(this, key, value); |
65 } | 66 } |
66 } | 67 } |
LEFT | RIGHT |