LEFT | RIGHT |
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.text; | 3 package com.ibm.icu.text; |
4 | 4 |
5 import java.io.IOException; | 5 import java.io.IOException; |
6 import java.io.ObjectInputStream; | 6 import java.io.ObjectInputStream; |
7 import java.io.ObjectOutputStream; | 7 import java.io.ObjectOutputStream; |
| 8 import java.io.ObjectStreamField; |
8 import java.math.BigInteger; | 9 import java.math.BigInteger; |
9 import java.math.RoundingMode; | 10 import java.math.RoundingMode; |
10 import java.text.AttributedCharacterIterator; | 11 import java.text.AttributedCharacterIterator; |
11 import java.text.FieldPosition; | 12 import java.text.FieldPosition; |
12 import java.text.ParseException; | 13 import java.text.ParseException; |
13 import java.text.ParsePosition; | 14 import java.text.ParsePosition; |
14 | 15 |
15 import com.ibm.icu.impl.number.AffixPatternUtils; | 16 import com.ibm.icu.impl.number.AffixPatternUtils; |
16 import com.ibm.icu.impl.number.Endpoint; | 17 import com.ibm.icu.impl.number.Endpoint; |
17 import com.ibm.icu.impl.number.Format.SingularFormat; | 18 import com.ibm.icu.impl.number.Format.SingularFormat; |
(...skipping 12 matching lines...) Expand all Loading... |
30 import com.ibm.icu.text.PluralRules.IFixedDecimal; | 31 import com.ibm.icu.text.PluralRules.IFixedDecimal; |
31 import com.ibm.icu.util.Currency; | 32 import com.ibm.icu.util.Currency; |
32 import com.ibm.icu.util.Currency.CurrencyUsage; | 33 import com.ibm.icu.util.Currency.CurrencyUsage; |
33 import com.ibm.icu.util.CurrencyAmount; | 34 import com.ibm.icu.util.CurrencyAmount; |
34 import com.ibm.icu.util.ULocale; | 35 import com.ibm.icu.util.ULocale; |
35 | 36 |
36 /** @stable ICU 2.0 */ | 37 /** @stable ICU 2.0 */ |
37 public class DecimalFormat extends NumberFormat { | 38 public class DecimalFormat extends NumberFormat { |
38 | 39 |
39 /** New serialization in ICU 59: declare different version from ICU 58. */ | 40 /** New serialization in ICU 59: declare different version from ICU 58. */ |
40 private static final long serialVersionUID = 864413376551465019L; | 41 private static final long serialVersionUID = 864413376551465018L; |
| 42 |
| 43 /** |
| 44 * One non-transient field such that deserialization can determine the version
of the class. This |
| 45 * field has existed since the very earliest versions of DecimalFormat. |
| 46 */ |
| 47 @SuppressWarnings("unused") |
| 48 private final int serialVersionOnStream = 5; |
41 | 49 |
42 //============================================================================
=========// | 50 //============================================================================
=========// |
43 // INSTANCE FIELDS
// | 51 // INSTANCE FIELDS
// |
44 //============================================================================
=========// | 52 //============================================================================
=========// |
45 | 53 |
46 // Fields are package-private, so that subclasses can use them. | 54 // Fields are package-private, so that subclasses can use them. |
47 // properties should be final, but clone won't work if we make it final. | 55 // properties should be final, but clone won't work if we make it final. |
48 // All fields are transient because custom serialization is used. | 56 // All fields are transient because custom serialization is used. |
49 | 57 |
50 /** | 58 /** |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 other.exportedProperties = new Properties(); | 227 other.exportedProperties = new Properties(); |
220 other.refreshFormatter(); | 228 other.refreshFormatter(); |
221 return other; | 229 return other; |
222 } | 230 } |
223 | 231 |
224 /** | 232 /** |
225 * Custom serialization: save property bag and symbols; the formatter object c
an be re-created | 233 * Custom serialization: save property bag and symbols; the formatter object c
an be re-created |
226 * from just that amount of information. | 234 * from just that amount of information. |
227 */ | 235 */ |
228 private void writeObject(ObjectOutputStream oos) throws IOException { | 236 private void writeObject(ObjectOutputStream oos) throws IOException { |
| 237 // ICU 59 custom serialization. |
| 238 // Write class metadata and serialVersionOnStream field: |
229 oos.defaultWriteObject(); | 239 oos.defaultWriteObject(); |
230 // ICU 59 custom serialization. | 240 // Extra int for possible future use: |
231 // Extra int for possible future use | |
232 oos.writeInt(0); | 241 oos.writeInt(0); |
233 // 1) Property Bag | 242 // 1) Property Bag |
234 oos.writeObject(properties); | 243 oos.writeObject(properties); |
235 // 2) DecimalFormatSymbols | 244 // 2) DecimalFormatSymbols |
236 oos.writeObject(symbols); | 245 oos.writeObject(symbols); |
237 } | 246 } |
238 | 247 |
239 /** Custom serialization: re-create object from serialized property bag and sy
mbols. */ | 248 /** |
| 249 * Custom serialization: re-create object from serialized property bag and sym
bols. Also supports |
| 250 * reading from the legacy (pre-ICU4J 59) format and converting it to the new
form. |
| 251 */ |
240 private void readObject(ObjectInputStream ois) throws IOException, ClassNotFou
ndException { | 252 private void readObject(ObjectInputStream ois) throws IOException, ClassNotFou
ndException { |
241 ois.defaultReadObject(); | 253 ObjectInputStream.GetField fieldGetter = ois.readFields(); |
242 // Extra int for possible future use | 254 ObjectStreamField[] serializedFields = fieldGetter.getObjectStreamClass().ge
tFields(); |
243 ois.readInt(); | 255 int serialVersion = fieldGetter.get("serialVersionOnStream", -1); |
244 // 1) Property Bag | 256 |
245 properties = (Properties) ois.readObject(); | 257 if (serialVersion > 5) { |
246 // 2) DecimalFormatSymbols | 258 throw new IOException( |
247 symbols = (DecimalFormatSymbols) ois.readObject(); | 259 "Cannot deserialize newer com.ibm.icu.text.DecimalFormat (v" + serialV
ersion + ")"); |
248 // Re-build transient fields | 260 } else if (serialVersion == 5) { |
249 exportedProperties = new Properties(); | 261 ///// ICU 59+ SERIALIZATION FORMAT ///// |
250 refreshFormatter(); | 262 // We expect this field and no other fields: |
| 263 if (serializedFields.length > 1) { |
| 264 throw new IOException("Too many fields when reading serial version 5"); |
| 265 } |
| 266 // Extra int for possible future use: |
| 267 ois.readInt(); |
| 268 // 1) Property Bag |
| 269 properties = (Properties) ois.readObject(); |
| 270 // 2) DecimalFormatSymbols |
| 271 symbols = (DecimalFormatSymbols) ois.readObject(); |
| 272 // Re-build transient fields |
| 273 exportedProperties = new Properties(); |
| 274 refreshFormatter(); |
| 275 } else { |
| 276 ///// LEGACY SERIALIZATION FORMAT ///// |
| 277 properties = new Properties(); |
| 278 // Loop through the fields. Not all fields necessarily exist in the serial
ization. |
| 279 String pp = null, ppp = null, ps = null, psp = null; |
| 280 String np = null, npp = null, ns = null, nsp = null; |
| 281 for (ObjectStreamField field : serializedFields) { |
| 282 String name = field.getName(); |
| 283 if (name.equals("decimalSeparatorAlwaysShown")) { |
| 284 setDecimalSeparatorAlwaysShown(fieldGetter.get("decimalSeparatorAlways
Shown", false)); |
| 285 } else if (name.equals("exponentSignAlwaysShown")) { |
| 286 setExponentSignAlwaysShown(fieldGetter.get("exponentSignAlwaysShown",
false)); |
| 287 } else if (name.equals("formatWidth")) { |
| 288 setFormatWidth(fieldGetter.get("formatWidth", 0)); |
| 289 } else if (name.equals("groupingSize")) { |
| 290 setGroupingSize(fieldGetter.get("groupingSize", (byte) 3)); |
| 291 } else if (name.equals("groupingSize2")) { |
| 292 setSecondaryGroupingSize(fieldGetter.get("groupingSize2", (byte) 0)); |
| 293 } else if (name.equals("maxSignificantDigits")) { |
| 294 setMaximumSignificantDigits(fieldGetter.get("maxSignificantDigits", 6)
); |
| 295 } else if (name.equals("minExponentDigits")) { |
| 296 setMinimumExponentDigits(fieldGetter.get("minExponentDigits", (byte) 0
)); |
| 297 } else if (name.equals("minSignificantDigits")) { |
| 298 setMinimumSignificantDigits(fieldGetter.get("minSignificantDigits", 1)
); |
| 299 } else if (name.equals("multiplier")) { |
| 300 setMultiplier(fieldGetter.get("multiplier", 1)); |
| 301 } else if (name.equals("pad")) { |
| 302 setPadCharacter(fieldGetter.get("pad", '\u0020')); |
| 303 } else if (name.equals("padPosition")) { |
| 304 setPadPosition(fieldGetter.get("padPosition", 0)); |
| 305 } else if (name.equals("parseBigDecimal")) { |
| 306 setParseBigDecimal(fieldGetter.get("parseBigDecimal", false)); |
| 307 } else if (name.equals("parseRequireDecimalPoint")) { |
| 308 setDecimalPatternMatchRequired(fieldGetter.get("parseRequireDecimalPoi
nt", false)); |
| 309 } else if (name.equals("roundingMode")) { |
| 310 setRoundingMode(fieldGetter.get("roundingMode", 0)); |
| 311 } else if (name.equals("useExponentialNotation")) { |
| 312 setScientificNotation(fieldGetter.get("useExponentialNotation", false)
); |
| 313 } else if (name.equals("useSignificantDigits")) { |
| 314 setSignificantDigitsUsed(fieldGetter.get("useSignificantDigits", false
)); |
| 315 } else if (name.equals("currencyPluralInfo")) { |
| 316 setCurrencyPluralInfo((CurrencyPluralInfo) fieldGetter.get("currencyPl
uralInfo", null)); |
| 317 } else if (name.equals("currencyUsage")) { |
| 318 setCurrencyUsage((CurrencyUsage) fieldGetter.get("currencyUsage", null
)); |
| 319 } else if (name.equals("mathContext")) { |
| 320 setMathContextICU((MathContext) fieldGetter.get("mathContext", null)); |
| 321 } else if (name.equals("negPrefixPattern")) { |
| 322 npp = (String) fieldGetter.get("negPrefixPattern", null); |
| 323 } else if (name.equals("negSuffixPattern")) { |
| 324 nsp = (String) fieldGetter.get("negSuffixPattern", null); |
| 325 } else if (name.equals("negativePrefix")) { |
| 326 np = (String) fieldGetter.get("negativePrefix", null); |
| 327 } else if (name.equals("negativeSuffix")) { |
| 328 ns = (String) fieldGetter.get("negativeSuffix", null); |
| 329 } else if (name.equals("posPrefixPattern")) { |
| 330 ppp = (String) fieldGetter.get("posPrefixPattern", null); |
| 331 } else if (name.equals("posSuffixPattern")) { |
| 332 psp = (String) fieldGetter.get("posSuffixPattern", null); |
| 333 } else if (name.equals("positivePrefix")) { |
| 334 pp = (String) fieldGetter.get("positivePrefix", null); |
| 335 } else if (name.equals("positiveSuffix")) { |
| 336 ps = (String) fieldGetter.get("positiveSuffix", null); |
| 337 } else if (name.equals("roundingIncrement")) { |
| 338 setRoundingIncrement((java.math.BigDecimal) fieldGetter.get("roundingI
ncrement", null)); |
| 339 } else if (name.equals("symbols")) { |
| 340 setDecimalFormatSymbols((DecimalFormatSymbols) fieldGetter.get("symbol
s", null)); |
| 341 } else { |
| 342 // The following fields are ignored: |
| 343 // "PARSE_MAX_EXPONENT" |
| 344 // "currencySignCount" |
| 345 // "style" |
| 346 // "attributes" |
| 347 // "currencyChoice" |
| 348 // "formatPattern" |
| 349 } |
| 350 } |
| 351 // Resolve affixes |
| 352 if (npp == null) { |
| 353 properties.setNegativePrefix(np); |
| 354 } else { |
| 355 properties.setNegativePrefixPattern(npp); |
| 356 } |
| 357 if (nsp == null) { |
| 358 properties.setNegativeSuffix(ns); |
| 359 } else { |
| 360 properties.setNegativeSuffixPattern(nsp); |
| 361 } |
| 362 if (ppp == null) { |
| 363 properties.setPositivePrefix(pp); |
| 364 } else { |
| 365 properties.setPositivePrefixPattern(ppp); |
| 366 } |
| 367 if (psp == null) { |
| 368 properties.setPositiveSuffix(ps); |
| 369 } else { |
| 370 properties.setPositiveSuffixPattern(psp); |
| 371 } |
| 372 // Extract values from parent NumberFormat class. Have to use reflection
here. |
| 373 java.lang.reflect.Field getter; |
| 374 try { |
| 375 getter = NumberFormat.class.getDeclaredField("groupingUsed"); |
| 376 getter.setAccessible(true); |
| 377 setGroupingUsed((Boolean) getter.get(this)); |
| 378 getter = NumberFormat.class.getDeclaredField("parseIntegerOnly"); |
| 379 getter.setAccessible(true); |
| 380 setParseIntegerOnly((Boolean) getter.get(this)); |
| 381 getter = NumberFormat.class.getDeclaredField("maximumIntegerDigits"); |
| 382 getter.setAccessible(true); |
| 383 setMaximumIntegerDigits((Integer) getter.get(this)); |
| 384 getter = NumberFormat.class.getDeclaredField("minimumIntegerDigits"); |
| 385 getter.setAccessible(true); |
| 386 setMinimumIntegerDigits((Integer) getter.get(this)); |
| 387 getter = NumberFormat.class.getDeclaredField("maximumFractionDigits"); |
| 388 getter.setAccessible(true); |
| 389 setMaximumFractionDigits((Integer) getter.get(this)); |
| 390 getter = NumberFormat.class.getDeclaredField("minimumFractionDigits"); |
| 391 getter.setAccessible(true); |
| 392 setMinimumFractionDigits((Integer) getter.get(this)); |
| 393 getter = NumberFormat.class.getDeclaredField("currency"); |
| 394 getter.setAccessible(true); |
| 395 setCurrency((Currency) getter.get(this)); |
| 396 getter = NumberFormat.class.getDeclaredField("parseStrict"); |
| 397 getter.setAccessible(true); |
| 398 setParseStrict((Boolean) getter.get(this)); |
| 399 } catch (IllegalArgumentException e) { |
| 400 throw new IOException(e); |
| 401 } catch (IllegalAccessException e) { |
| 402 throw new IOException(e); |
| 403 } catch (NoSuchFieldException e) { |
| 404 throw new IOException(e); |
| 405 } catch (SecurityException e) { |
| 406 throw new IOException(e); |
| 407 } |
| 408 // Finish initialization |
| 409 if (symbols == null) { |
| 410 symbols = getDefaultSymbols(); |
| 411 } |
| 412 exportedProperties = new Properties(); |
| 413 refreshFormatter(); |
| 414 } |
251 } | 415 } |
252 | 416 |
253 //============================================================================
=========// | 417 //============================================================================
=========// |
254 // FORMAT AND PARSE APIS
// | 418 // FORMAT AND PARSE APIS
// |
255 //============================================================================
=========// | 419 //============================================================================
=========// |
256 | 420 |
257 /** @stable ICU 2.0 */ | 421 /** @stable ICU 2.0 */ |
258 @Override | 422 @Override |
259 public StringBuffer format(double number, StringBuffer result, FieldPosition f
ieldPosition) { | 423 public StringBuffer format(double number, StringBuffer result, FieldPosition f
ieldPosition) { |
260 FormatQuantity4 fq = new FormatQuantity4(number); | 424 FormatQuantity4 fq = new FormatQuantity4(number); |
(...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
726 * @see java.math.MathContext | 890 * @see java.math.MathContext |
727 * @category Rounding | 891 * @category Rounding |
728 * @stable ICU 4.2 | 892 * @stable ICU 4.2 |
729 */ | 893 */ |
730 public synchronized void setMathContext(java.math.MathContext mathContext) { | 894 public synchronized void setMathContext(java.math.MathContext mathContext) { |
731 properties.setMathContext(mathContext); | 895 properties.setMathContext(mathContext); |
732 refreshFormatter(); | 896 refreshFormatter(); |
733 } | 897 } |
734 | 898 |
735 // Remember the ICU math context form in order to be able to return it from th
e API. | 899 // Remember the ICU math context form in order to be able to return it from th
e API. |
736 private int icuMathContextForm = MathContext.PLAIN; | 900 // NOTE: This value is not serialized. (should it be?) |
| 901 private transient int icuMathContextForm = MathContext.PLAIN; |
737 | 902 |
738 /** | 903 /** |
739 * @return The {@link com.ibm.icu.math.MathContext} being used to round number
s. | 904 * @return The {@link com.ibm.icu.math.MathContext} being used to round number
s. |
740 * @see #setMathContext | 905 * @see #setMathContext |
741 * @category Rounding | 906 * @category Rounding |
742 * @stable ICU 4.2 | 907 * @stable ICU 4.2 |
743 */ | 908 */ |
744 public synchronized MathContext getMathContextICU() { | 909 public synchronized MathContext getMathContextICU() { |
745 java.math.MathContext mathContext = getMathContext(); | 910 java.math.MathContext mathContext = getMathContext(); |
746 return new MathContext( | 911 return new MathContext( |
(...skipping 985 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1732 @Deprecated | 1897 @Deprecated |
1733 public synchronized void setParseCaseSensitive(boolean value) { | 1898 public synchronized void setParseCaseSensitive(boolean value) { |
1734 properties.setParseCaseSensitive(value); | 1899 properties.setParseCaseSensitive(value); |
1735 refreshFormatter(); | 1900 refreshFormatter(); |
1736 } | 1901 } |
1737 | 1902 |
1738 //============================================================================
=========// | 1903 //============================================================================
=========// |
1739 // UTILITIES
// | 1904 // UTILITIES
// |
1740 //============================================================================
=========// | 1905 //============================================================================
=========// |
1741 | 1906 |
1742 /** @stable ICU 2.0 */ | 1907 /** |
| 1908 * Tests for equality between this formatter and another formatter. |
| 1909 * |
| 1910 * <p>If two DecimalFormat instances are equal, then they will always produce
the same output. |
| 1911 * However, the reverse is not necessarily true: if two DecimalFormat instance
s always produce the |
| 1912 * same output, they are not necessarily equal. |
| 1913 * |
| 1914 * @stable ICU 2.0 |
| 1915 */ |
1743 @Override | 1916 @Override |
1744 public synchronized boolean equals(Object obj) { | 1917 public synchronized boolean equals(Object obj) { |
1745 if (obj == null) return false; | 1918 if (obj == null) return false; |
1746 if (obj == this) return true; | 1919 if (obj == this) return true; |
1747 if (!(obj instanceof DecimalFormat)) return false; | 1920 if (!(obj instanceof DecimalFormat)) return false; |
1748 DecimalFormat other = (DecimalFormat) obj; | 1921 DecimalFormat other = (DecimalFormat) obj; |
1749 return properties.equals(other.properties) && symbols.equals(other.symbols); | 1922 return properties.equals(other.properties) && symbols.equals(other.symbols); |
1750 } | 1923 } |
1751 | 1924 |
1752 /** @stable ICU 2.0 */ | 1925 /** @stable ICU 2.0 */ |
1753 @Override | 1926 @Override |
1754 public synchronized int hashCode() { | 1927 public synchronized int hashCode() { |
1755 return properties.hashCode(); | 1928 return properties.hashCode(); |
1756 } | 1929 } |
1757 | 1930 |
1758 private static final ThreadLocal<Properties> threadLocalToPatternProperties = | 1931 private static final ThreadLocal<Properties> threadLocalToPatternProperties = |
1759 new ThreadLocal<Properties>() { | 1932 new ThreadLocal<Properties>() { |
1760 @Override | 1933 @Override |
1761 protected Properties initialValue() { | 1934 protected Properties initialValue() { |
1762 return new Properties(); | 1935 return new Properties(); |
1763 } | 1936 } |
1764 }; | 1937 }; |
| 1938 |
| 1939 @Override |
| 1940 public synchronized String toString() { |
| 1941 return "<DecimalFormat " + symbols.toString() + " " + properties.toString()
+ ">"; |
| 1942 } |
1765 | 1943 |
1766 /** | 1944 /** |
1767 * Serializes this formatter object to a decimal format pattern string. The re
sult of this method | 1945 * Serializes this formatter object to a decimal format pattern string. The re
sult of this method |
1768 * is guaranteed to be <em>functionally</em> equivalent to the pattern string
used to create this | 1946 * is guaranteed to be <em>functionally</em> equivalent to the pattern string
used to create this |
1769 * instance after incorporating values from the setter methods. | 1947 * instance after incorporating values from the setter methods. |
1770 * | 1948 * |
1771 * <p>For more information on decimal format pattern strings, see <a | 1949 * <p>For more information on decimal format pattern strings, see <a |
1772 * href="http://unicode.org/reports/tr35/tr35-numbers.html#Number_Format_Patte
rns">UTS #35</a>. | 1950 * href="http://unicode.org/reports/tr35/tr35-numbers.html#Number_Format_Patte
rns">UTS #35</a>. |
1773 * | 1951 * |
1774 * <p><strong>Important:</strong> Not all properties are capable of being enco
ded in a pattern | 1952 * <p><strong>Important:</strong> Not all properties are capable of being enco
ded in a pattern |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1810 */ | 1988 */ |
1811 @Deprecated | 1989 @Deprecated |
1812 public IFixedDecimal getFixedDecimal(double number) { | 1990 public IFixedDecimal getFixedDecimal(double number) { |
1813 FormatQuantity4 fq = new FormatQuantity4(number); | 1991 FormatQuantity4 fq = new FormatQuantity4(number); |
1814 formatter.format(fq); | 1992 formatter.format(fq); |
1815 return fq; | 1993 return fq; |
1816 } | 1994 } |
1817 | 1995 |
1818 /** Rebuilds the formatter object from the property bag. */ | 1996 /** Rebuilds the formatter object from the property bag. */ |
1819 void refreshFormatter() { | 1997 void refreshFormatter() { |
| 1998 if (exportedProperties == null) { |
| 1999 // exportedProperties is null only when the formatter is not ready yet. |
| 2000 // The only time when this happens is during legacy deserialization. |
| 2001 return; |
| 2002 } |
1820 formatter = Endpoint.fromBTA(properties, symbols); | 2003 formatter = Endpoint.fromBTA(properties, symbols); |
1821 exportedProperties.clear(); | 2004 exportedProperties.clear(); |
1822 formatter.export(exportedProperties); | 2005 formatter.export(exportedProperties); |
1823 } | 2006 } |
1824 | 2007 |
1825 /** | 2008 /** |
1826 * Updates the property bag with settings from the given pattern. | 2009 * Updates the property bag with settings from the given pattern. |
1827 * | 2010 * |
1828 * @param pattern The pattern string to parse. | 2011 * @param pattern The pattern string to parse. |
1829 * @param ignoreRounding Whether to read rounding information from the string.
Set to false if | 2012 * @param ignoreRounding Whether to read rounding information from the string.
Set to false if |
1830 * CurrencyUsage is to be used instead. | 2013 * CurrencyUsage is to be used instead. |
1831 * @see PatternString#parseToExistingProperties | 2014 * @see PatternString#parseToExistingProperties |
1832 */ | 2015 */ |
1833 void setPropertiesFromPattern(String pattern, boolean ignoreRounding) { | 2016 void setPropertiesFromPattern(String pattern, boolean ignoreRounding) { |
1834 PatternString.parseToExistingProperties(pattern, properties, ignoreRounding)
; | 2017 PatternString.parseToExistingProperties(pattern, properties, ignoreRounding)
; |
1835 } | 2018 } |
1836 | 2019 |
1837 /** | 2020 /** |
1838 * @internal | 2021 * @internal |
1839 * @deprecated This API is a technical preview. | 2022 * @deprecated This API is ICU internal only. |
1840 */ | 2023 */ |
1841 @Deprecated | 2024 @Deprecated |
1842 public synchronized void setProperties(PropertySetter func) { | 2025 public synchronized void setProperties(PropertySetter func) { |
1843 func.set(properties); | 2026 func.set(properties); |
1844 refreshFormatter(); | 2027 refreshFormatter(); |
1845 } | 2028 } |
1846 | 2029 |
1847 public static interface PropertySetter { | 2030 public static interface PropertySetter { |
1848 public void set(Properties props); | 2031 public void set(Properties props); |
1849 } | 2032 } |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1893 * | 2076 * |
1894 * @see #setPadPosition | 2077 * @see #setPadPosition |
1895 * @see #getPadPosition | 2078 * @see #getPadPosition |
1896 * @see #PAD_BEFORE_PREFIX | 2079 * @see #PAD_BEFORE_PREFIX |
1897 * @see #PAD_AFTER_PREFIX | 2080 * @see #PAD_AFTER_PREFIX |
1898 * @see #PAD_BEFORE_SUFFIX | 2081 * @see #PAD_BEFORE_SUFFIX |
1899 * @stable ICU 2.0 | 2082 * @stable ICU 2.0 |
1900 */ | 2083 */ |
1901 public static final int PAD_AFTER_SUFFIX = 3; | 2084 public static final int PAD_AFTER_SUFFIX = 3; |
1902 } | 2085 } |
LEFT | RIGHT |