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.dev.test.format; | 3 package com.ibm.icu.dev.test.format; |
4 | 4 |
5 import java.math.BigDecimal; | 5 import java.math.BigDecimal; |
6 import java.math.RoundingMode; | 6 import java.math.RoundingMode; |
7 import java.text.ParseException; | 7 import java.text.ParseException; |
8 import java.text.ParsePosition; | 8 import java.text.ParsePosition; |
9 | 9 |
10 import com.ibm.icu.dev.test.format.DataDrivenNumberFormatTestUtility.CodeUnderTe
st; | 10 import com.ibm.icu.dev.test.format.DataDrivenNumberFormatTestUtility.CodeUnderTe
st; |
11 import com.ibm.icu.impl.number.Endpoint; | 11 import com.ibm.icu.impl.number.Endpoint; |
12 import com.ibm.icu.impl.number.Format; | 12 import com.ibm.icu.impl.number.Format; |
13 import com.ibm.icu.impl.number.FormatQuantity; | 13 import com.ibm.icu.impl.number.FormatQuantity; |
14 import com.ibm.icu.impl.number.FormatQuantity1; | 14 import com.ibm.icu.impl.number.FormatQuantity1; |
15 import com.ibm.icu.impl.number.FormatQuantity2; | 15 import com.ibm.icu.impl.number.FormatQuantity2; |
| 16 import com.ibm.icu.impl.number.FormatQuantity3; |
| 17 import com.ibm.icu.impl.number.FormatQuantity4; |
16 import com.ibm.icu.impl.number.Parse; | 18 import com.ibm.icu.impl.number.Parse; |
17 import com.ibm.icu.impl.number.Parse.ParseMode; | 19 import com.ibm.icu.impl.number.Parse.ParseMode; |
18 import com.ibm.icu.impl.number.PatternString; | 20 import com.ibm.icu.impl.number.PatternString; |
19 import com.ibm.icu.impl.number.Properties; | 21 import com.ibm.icu.impl.number.Properties; |
20 import com.ibm.icu.impl.number.formatters.PaddingFormat.PaddingLocation; | 22 import com.ibm.icu.impl.number.formatters.PaddingFormat.PadPosition; |
| 23 import com.ibm.icu.text.DecimalFormat; |
| 24 import com.ibm.icu.text.DecimalFormat.PropertySetter; |
21 import com.ibm.icu.text.DecimalFormatSymbols; | 25 import com.ibm.icu.text.DecimalFormatSymbols; |
| 26 import com.ibm.icu.util.CurrencyAmount; |
22 import com.ibm.icu.util.ULocale; | 27 import com.ibm.icu.util.ULocale; |
23 | 28 |
24 public class ShanesDataDrivenTester extends CodeUnderTest { | 29 public class ShanesDataDrivenTester extends CodeUnderTest { |
25 static final String dataPath = | 30 static final String dataPath = |
26 "../../../icu4j-core-tests/src/com/ibm/icu/dev/data/numberformattestspecif
ication.txt"; | 31 "../../../icu4j-core-tests/src/com/ibm/icu/dev/data/numberformattestspecif
ication.txt"; |
27 | 32 |
28 public static void run() { | 33 public static void run() { |
29 CodeUnderTest tester = new ShanesDataDrivenTester(); | 34 CodeUnderTest tester = new ShanesDataDrivenTester(); |
30 DataDrivenNumberFormatTestUtility.runSuite(dataPath, tester); | 35 DataDrivenNumberFormatTestUtility.runFormatSuiteIncludingKnownFailures(dataP
ath, tester); |
31 } | 36 } |
32 | 37 |
33 @Override | 38 @Override |
34 public Character Id() { | 39 public Character Id() { |
35 return 'S'; | 40 return 'S'; |
36 } | 41 } |
37 | 42 |
38 /** | 43 /** |
39 * Runs a single formatting test. On success, returns null. On failure, return
s the error. This | 44 * Runs a single formatting test. On success, returns null. On failure, return
s the error. This |
40 * implementation just returns null. Subclasses should override. | 45 * implementation just returns null. Subclasses should override. |
41 * | 46 * |
42 * @param tuple contains the parameters of the format test. | 47 * @param tuple contains the parameters of the format test. |
43 */ | 48 */ |
44 @Override | 49 @Override |
45 public String format(NumberFormatTestData tuple) { | 50 public String format(DataDrivenNumberFormatTestData tuple) { |
46 String pattern = (tuple.pattern == null) ? "0" : tuple.pattern; | 51 String pattern = (tuple.pattern == null) ? "0" : tuple.pattern; |
47 ULocale locale = (tuple.locale == null) ? ULocale.ENGLISH : tuple.locale; | 52 ULocale locale = (tuple.locale == null) ? ULocale.ENGLISH : tuple.locale; |
48 Format fmt; | 53 Properties properties = PatternString.parseToProperties(pattern, tuple.curre
ncy != null); |
49 try { | 54 propertiesFromTuple(tuple, properties); |
50 Properties properties = PatternString.parseToProperties(pattern); | 55 Format fmt = Endpoint.fromBTA(properties, locale); |
51 propertiesFromTuple(tuple, properties); | |
52 System.out.println(properties); | |
53 fmt = Endpoint.fromBTA(properties, locale); | |
54 } catch (ParseException e) { | |
55 e.printStackTrace(); | |
56 return e.getLocalizedMessage(); | |
57 } | |
58 FormatQuantity q1, q2, q3; | 56 FormatQuantity q1, q2, q3; |
59 if (tuple.format.equals("NaN")) { | 57 if (tuple.format.equals("NaN")) { |
60 q1 = q2 = new FormatQuantity1(Double.NaN); | 58 q1 = q2 = new FormatQuantity1(Double.NaN); |
61 q3 = new FormatQuantity2(Double.NaN); | 59 q3 = new FormatQuantity2(Double.NaN); |
62 } else if (tuple.format.equals("-Inf")) { | 60 } else if (tuple.format.equals("-Inf")) { |
63 q1 = q2 = new FormatQuantity1(Double.NEGATIVE_INFINITY); | 61 q1 = q2 = new FormatQuantity1(Double.NEGATIVE_INFINITY); |
64 q3 = new FormatQuantity1(Double.NEGATIVE_INFINITY); | 62 q3 = new FormatQuantity1(Double.NEGATIVE_INFINITY); |
65 } else if (tuple.format.equals("Inf")) { | 63 } else if (tuple.format.equals("Inf")) { |
66 q1 = q2 = new FormatQuantity1(Double.POSITIVE_INFINITY); | 64 q1 = q2 = new FormatQuantity1(Double.POSITIVE_INFINITY); |
67 q3 = new FormatQuantity1(Double.POSITIVE_INFINITY); | 65 q3 = new FormatQuantity1(Double.POSITIVE_INFINITY); |
68 } else { | 66 } else { |
69 q1 = new FormatQuantity1(new BigDecimal(tuple.format)); | 67 BigDecimal d = new BigDecimal(tuple.format); |
70 q2 = new FormatQuantity1(Double.parseDouble(tuple.format)); | 68 if (d.precision() <= 16) { |
71 q3 = new FormatQuantity2(new BigDecimal(tuple.format)); | 69 q1 = new FormatQuantity1(d); |
| 70 q2 = new FormatQuantity1(Double.parseDouble(tuple.format)); |
| 71 q3 = new FormatQuantity4(d); |
| 72 } else { |
| 73 q1 = new FormatQuantity1(d); |
| 74 q2 = new FormatQuantity3(d); |
| 75 q3 = new FormatQuantity4(d); // duplicate values so no null |
| 76 } |
72 } | 77 } |
73 String expected = tuple.output; | 78 String expected = tuple.output; |
74 String actual1 = fmt.format(q1); | 79 String actual1 = fmt.format(q1); |
75 if (!expected.equals(actual1)) { | 80 if (!expected.equals(actual1)) { |
76 return "Expected \"" + expected + "\", got \"" + actual1 + "\" on BigDecim
al"; | 81 return "Expected \"" + expected + "\", got \"" + actual1 + "\" on FormatQu
antity1 BigDecimal"; |
77 } | 82 } |
78 String actual2 = fmt.format(q2); | 83 String actual2 = fmt.format(q2); |
79 if (!expected.equals(actual2)) { | 84 if (!expected.equals(actual2)) { |
80 return "Expected \"" + expected + "\", got \"" + actual2 + "\" on double"; | 85 return "Expected \"" + expected + "\", got \"" + actual2 + "\" on FormatQu
antity1 double"; |
81 } | 86 } |
82 String actual3 = fmt.format(q3); | 87 String actual3 = fmt.format(q3); |
83 if (!expected.equals(actual3)) { | 88 if (!expected.equals(actual3)) { |
84 return "Expected \"" + expected + "\", got \"" + actual3 + "\" on double"; | 89 return "Expected \"" + expected + "\", got \"" + actual3 + "\" on FormatQu
antity4 BigDecimal"; |
85 } | 90 } |
86 return null; | 91 return null; |
87 } | 92 } |
88 | 93 |
89 /** | 94 /** |
90 * Runs a single toPattern test. On success, returns null. On failure, returns
the error. This | 95 * Runs a single toPattern test. On success, returns null. On failure, returns
the error. This |
91 * implementation just returns null. Subclasses should override. | 96 * implementation just returns null. Subclasses should override. |
92 * | 97 * |
93 * @param tuple contains the parameters of the format test. | 98 * @param tuple contains the parameters of the format test. |
94 */ | 99 */ |
95 @Override | 100 @Override |
96 public String toPattern(NumberFormatTestData tuple) { | 101 public String toPattern(DataDrivenNumberFormatTestData tuple) { |
97 String pattern = (tuple.pattern == null) ? "0" : tuple.pattern; | 102 String pattern = (tuple.pattern == null) ? "0" : tuple.pattern; |
98 Properties properties; | 103 final Properties properties; |
| 104 DecimalFormat df; |
99 try { | 105 try { |
100 properties = PatternString.parseToProperties(pattern); | 106 properties = PatternString.parseToProperties(pattern, tuple.currency != nu
ll); |
101 propertiesFromTuple(tuple, properties); | 107 propertiesFromTuple(tuple, properties); |
102 System.out.println(properties); | 108 // TODO: Use PatternString.propertiesToString() directly. (How to deal wit
h CurrencyUsage?) |
103 } catch (ParseException e) { | 109 df = new DecimalFormat(); |
| 110 df.setProperties( |
| 111 new PropertySetter() { |
| 112 @Override |
| 113 public void set(Properties props) { |
| 114 props.copyFrom(properties); |
| 115 } |
| 116 }); |
| 117 } catch (IllegalArgumentException e) { |
104 e.printStackTrace(); | 118 e.printStackTrace(); |
105 return e.getLocalizedMessage(); | 119 return e.getLocalizedMessage(); |
106 } | 120 } |
107 | 121 |
108 if (tuple.toPattern != null) { | 122 if (tuple.toPattern != null) { |
109 String expected = tuple.toPattern; | 123 String expected = tuple.toPattern; |
110 String actual = PatternString.propertiesToString(properties); | 124 String actual = df.toPattern(); |
111 if (!expected.equals(actual)) { | 125 if (!expected.equals(actual)) { |
112 return "Expected toPattern='" + expected + "'; got '" + actual + "'"; | 126 return "Expected toPattern='" + expected + "'; got '" + actual + "'"; |
113 } | 127 } |
114 } | 128 } |
115 if (tuple.toLocalizedPattern != null) { | 129 if (tuple.toLocalizedPattern != null) { |
116 String expected = tuple.toLocalizedPattern; | 130 String expected = tuple.toLocalizedPattern; |
117 String actual = PatternString.propertiesToString(properties); | 131 String actual = PatternString.propertiesToString(properties); |
118 if (!expected.equals(actual)) { | 132 if (!expected.equals(actual)) { |
119 return "Expected toLocalizedPattern='" + expected + "'; got '" + actual
+ "'"; | 133 return "Expected toLocalizedPattern='" + expected + "'; got '" + actual
+ "'"; |
120 } | 134 } |
121 } | 135 } |
122 return null; | 136 return null; |
123 } | 137 } |
124 | 138 |
125 /** | 139 /** |
126 * Runs a single parse test. On success, returns null. On failure, returns the
error. This | 140 * Runs a single parse test. On success, returns null. On failure, returns the
error. This |
127 * implementation just returns null. Subclasses should override. | 141 * implementation just returns null. Subclasses should override. |
128 * | 142 * |
129 * @param tuple contains the parameters of the format test. | 143 * @param tuple contains the parameters of the format test. |
130 */ | 144 */ |
131 @Override | 145 @Override |
132 public String parse(NumberFormatTestData tuple) { | 146 public String parse(DataDrivenNumberFormatTestData tuple) { |
133 String pattern = (tuple.pattern == null) ? "0" : tuple.pattern; | 147 String pattern = (tuple.pattern == null) ? "0" : tuple.pattern; |
134 Properties properties; | 148 Properties properties; |
135 ParsePosition ppos = new ParsePosition(0); | 149 ParsePosition ppos = new ParsePosition(0); |
136 Number actual; | 150 Number actual; |
137 try { | 151 try { |
138 properties = PatternString.parseToProperties(pattern); | 152 properties = PatternString.parseToProperties(pattern, tuple.currency != nu
ll); |
139 propertiesFromTuple(tuple, properties); | 153 propertiesFromTuple(tuple, properties); |
140 actual = | 154 actual = |
141 Parse.parse( | 155 Parse.parse( |
142 tuple.parse, | 156 tuple.parse, ppos, properties, DecimalFormatSymbols.getInstance(tu
ple.locale)); |
143 ppos, | 157 } catch (IllegalArgumentException e) { |
144 properties, | 158 return "parse exception: " + e.getMessage(); |
145 DecimalFormatSymbols.getInstance(tuple.locale)); | 159 } |
| 160 if (actual == null && ppos.getIndex() != 0) { |
| 161 throw new AssertionError("Error: value is null but parse position is not z
ero"); |
| 162 } |
| 163 if (ppos.getIndex() == 0) { |
| 164 return "Parse failed; got " + actual + ", but expected " + tuple.output; |
| 165 } |
| 166 if (tuple.output.equals("NaN")) { |
| 167 if (!Double.isNaN(actual.doubleValue())) { |
| 168 return "Expected NaN, but got: " + actual; |
| 169 } |
| 170 return null; |
| 171 } else if (tuple.output.equals("Inf")) { |
| 172 if (!Double.isInfinite(actual.doubleValue()) |
| 173 || Double.compare(actual.doubleValue(), 0.0) < 0) { |
| 174 return "Expected Inf, but got: " + actual; |
| 175 } |
| 176 return null; |
| 177 } else if (tuple.output.equals("-Inf")) { |
| 178 if (!Double.isInfinite(actual.doubleValue()) |
| 179 || Double.compare(actual.doubleValue(), 0.0) > 0) { |
| 180 return "Expected -Inf, but got: " + actual; |
| 181 } |
| 182 return null; |
| 183 } else if (tuple.output.equals("fail")) { |
| 184 return null; |
| 185 } else if (new BigDecimal(tuple.output).compareTo(new BigDecimal(actual.toSt
ring())) != 0) { |
| 186 return "Expected: " + tuple.output + ", got: " + actual; |
| 187 } else { |
| 188 return null; |
| 189 } |
| 190 } |
| 191 |
| 192 /** |
| 193 * Runs a single parse currency test. On success, returns null. On failure, re
turns the error. |
| 194 * This implementation just returns null. Subclasses should override. |
| 195 * |
| 196 * @param tuple contains the parameters of the format test. |
| 197 */ |
| 198 @Override |
| 199 public String parseCurrency(DataDrivenNumberFormatTestData tuple) { |
| 200 String pattern = (tuple.pattern == null) ? "0" : tuple.pattern; |
| 201 Properties properties; |
| 202 ParsePosition ppos = new ParsePosition(0); |
| 203 CurrencyAmount actual; |
| 204 try { |
| 205 properties = PatternString.parseToProperties(pattern, tuple.currency != nu
ll); |
| 206 propertiesFromTuple(tuple, properties); |
| 207 actual = |
| 208 Parse.parseCurrency( |
| 209 tuple.parse, ppos, properties, DecimalFormatSymbols.getInstance(tu
ple.locale)); |
146 } catch (ParseException e) { | 210 } catch (ParseException e) { |
147 e.printStackTrace(); | 211 e.printStackTrace(); |
148 return e.getLocalizedMessage(); | 212 return "parse exception: " + e.getMessage(); |
149 } | 213 } |
150 if (ppos.getIndex() == 0) { | 214 if (ppos.getIndex() == 0 || actual.getCurrency().getCurrencyCode().equals("X
XX")) { |
151 if (!tuple.output.equals("fail")) { | 215 return "Parse failed; got " + actual + ", but expected " + tuple.output; |
152 return "Parse failed; got " + actual + ", but expected " + tuple.output; | 216 } |
153 } | 217 BigDecimal expectedNumber = new BigDecimal(tuple.output); |
154 return null; | 218 if (expectedNumber.compareTo(new BigDecimal(actual.getNumber().toString()))
!= 0) { |
155 } | 219 return "Wrong number: Expected: " + expectedNumber + ", got: " + actual; |
156 if (tuple.output.equals("fail")) { | 220 } |
157 return "Parse succeeded: " + actual + ", but was expected to fail."; | 221 String expectedCurrency = tuple.outputCurrency; |
158 } | 222 if (!expectedCurrency.equals(actual.getCurrency().toString())) { |
159 BigDecimal expected = new BigDecimal(tuple.output); | 223 return "Wrong currency: Expected: " + expectedCurrency + ", got: " + actua
l; |
160 if (expected.compareTo(new BigDecimal(actual.toString())) != 0) { | 224 } |
161 return "Expected: " + expected + ", got: " + actual; | |
162 } | |
163 return null; | |
164 } | |
165 | |
166 /** | |
167 * Runs a single parse currency test. On success, returns null. On failure, re
turns the error. | |
168 * This implementation just returns null. Subclasses should override. | |
169 * | |
170 * @param tuple contains the parameters of the format test. | |
171 */ | |
172 @Override | |
173 public String parseCurrency(NumberFormatTestData tuple) { | |
174 return null; | 225 return null; |
175 } | 226 } |
176 | 227 |
177 /** | 228 /** |
178 * Runs a single select test. On success, returns null. On failure, returns th
e error. This | 229 * Runs a single select test. On success, returns null. On failure, returns th
e error. This |
179 * implementation just returns null. Subclasses should override. | 230 * implementation just returns null. Subclasses should override. |
180 * | 231 * |
181 * @param tuple contains the parameters of the format test. | 232 * @param tuple contains the parameters of the format test. |
182 */ | 233 */ |
183 @Override | 234 @Override |
184 public String select(NumberFormatTestData tuple) { | 235 public String select(DataDrivenNumberFormatTestData tuple) { |
185 return null; | 236 return null; |
186 } | 237 } |
187 | 238 |
188 private static void propertiesFromTuple(NumberFormatTestData tuple, Properties
properties) { | 239 private static void propertiesFromTuple( |
| 240 DataDrivenNumberFormatTestData tuple, Properties properties) { |
189 if (tuple.minIntegerDigits != null) { | 241 if (tuple.minIntegerDigits != null) { |
190 properties.setMinimumIntegerDigits(tuple.minIntegerDigits); | 242 properties.setMinimumIntegerDigits(tuple.minIntegerDigits); |
191 } | 243 } |
192 if (tuple.maxIntegerDigits != null) { | 244 if (tuple.maxIntegerDigits != null) { |
193 properties.setMaximumIntegerDigits(tuple.maxIntegerDigits); | 245 properties.setMaximumIntegerDigits(tuple.maxIntegerDigits); |
194 } | 246 } |
195 if (tuple.minFractionDigits != null) { | 247 if (tuple.minFractionDigits != null) { |
196 properties.setMinimumFractionDigits(tuple.minFractionDigits); | 248 properties.setMinimumFractionDigits(tuple.minFractionDigits); |
197 } | 249 } |
198 if (tuple.maxFractionDigits != null) { | 250 if (tuple.maxFractionDigits != null) { |
(...skipping 15 matching lines...) Expand all Loading... |
214 properties.setMaximumSignificantDigits(tuple.maxSigDigits); | 266 properties.setMaximumSignificantDigits(tuple.maxSigDigits); |
215 } | 267 } |
216 if (tuple.useGrouping != null && tuple.useGrouping == 0) { | 268 if (tuple.useGrouping != null && tuple.useGrouping == 0) { |
217 properties.setGroupingSize(Integer.MAX_VALUE); | 269 properties.setGroupingSize(Integer.MAX_VALUE); |
218 properties.setSecondaryGroupingSize(Integer.MAX_VALUE); | 270 properties.setSecondaryGroupingSize(Integer.MAX_VALUE); |
219 } | 271 } |
220 if (tuple.multiplier != null) { | 272 if (tuple.multiplier != null) { |
221 properties.setMultiplier(new BigDecimal(tuple.multiplier)); | 273 properties.setMultiplier(new BigDecimal(tuple.multiplier)); |
222 } | 274 } |
223 if (tuple.roundingIncrement != null) { | 275 if (tuple.roundingIncrement != null) { |
224 properties.setRoundingInterval(new BigDecimal(tuple.roundingIncrement.toSt
ring())); | 276 properties.setRoundingIncrement(new BigDecimal(tuple.roundingIncrement.toS
tring())); |
225 } | 277 } |
226 if (tuple.formatWidth != null) { | 278 if (tuple.formatWidth != null) { |
227 properties.setPaddingWidth(tuple.formatWidth); | 279 properties.setFormatWidth(tuple.formatWidth); |
228 } | 280 } |
229 if (tuple.padCharacter != null && tuple.padCharacter.length() > 0) { | 281 if (tuple.padCharacter != null && tuple.padCharacter.length() > 0) { |
230 properties.setPaddingString(tuple.padCharacter.toString()); | 282 properties.setPadString(tuple.padCharacter.toString()); |
231 } | 283 } |
232 if (tuple.useScientific != null) { | 284 if (tuple.useScientific != null) { |
233 properties.setExponentDigits(tuple.useScientific); | 285 properties.setMinimumExponentDigits( |
| 286 tuple.useScientific != 0 ? 1 : Properties.DEFAULT_MINIMUM_EXPONENT_DIG
ITS); |
234 } | 287 } |
235 if (tuple.grouping != null) { | 288 if (tuple.grouping != null) { |
236 properties.setGroupingSize(tuple.grouping); | 289 properties.setGroupingSize(tuple.grouping); |
237 } | 290 } |
238 if (tuple.grouping2 != null) { | 291 if (tuple.grouping2 != null) { |
239 properties.setSecondaryGroupingSize(tuple.grouping2); | 292 properties.setSecondaryGroupingSize(tuple.grouping2); |
240 } | 293 } |
241 if (tuple.roundingMode != null) { | 294 if (tuple.roundingMode != null) { |
242 properties.setRoundingMode(RoundingMode.valueOf(tuple.roundingMode)); | 295 properties.setRoundingMode(RoundingMode.valueOf(tuple.roundingMode)); |
243 } | 296 } |
244 if (tuple.currencyUsage != null) { | 297 if (tuple.currencyUsage != null) { |
245 properties.setCurrencyUsage(tuple.currencyUsage); | 298 properties.setCurrencyUsage(tuple.currencyUsage); |
246 } | 299 } |
247 if (tuple.minimumExponentDigits != null) { | 300 if (tuple.minimumExponentDigits != null) { |
248 properties.setExponentDigits(tuple.minimumExponentDigits.byteValue()); | 301 properties.setMinimumExponentDigits(tuple.minimumExponentDigits.byteValue(
)); |
249 } | 302 } |
250 if (tuple.exponentSignAlwaysShown != null) { | 303 if (tuple.exponentSignAlwaysShown != null) { |
251 properties.setExponentShowPlusSign(tuple.exponentSignAlwaysShown != 0); | 304 properties.setExponentSignAlwaysShown(tuple.exponentSignAlwaysShown != 0); |
252 } | 305 } |
253 if (tuple.decimalSeparatorAlwaysShown != null) { | 306 if (tuple.decimalSeparatorAlwaysShown != null) { |
254 properties.setAlwaysShowDecimal(tuple.decimalSeparatorAlwaysShown != 0); | 307 properties.setDecimalSeparatorAlwaysShown(tuple.decimalSeparatorAlwaysShow
n != 0); |
255 } | 308 } |
256 if (tuple.padPosition != null) { | 309 if (tuple.padPosition != null) { |
257 properties.setPaddingLocation(PaddingLocation.fromOld(tuple.padPosition)); | 310 properties.setPadPosition(PadPosition.fromOld(tuple.padPosition)); |
258 } | 311 } |
259 if (tuple.positivePrefix != null) { | 312 if (tuple.positivePrefix != null) { |
260 properties.setPositivePrefix(tuple.positivePrefix); | 313 properties.setPositivePrefix(tuple.positivePrefix); |
261 } | 314 } |
262 if (tuple.positiveSuffix != null) { | 315 if (tuple.positiveSuffix != null) { |
263 properties.setPositiveSuffix(tuple.positiveSuffix); | 316 properties.setPositiveSuffix(tuple.positiveSuffix); |
264 } | 317 } |
265 if (tuple.negativePrefix != null) { | 318 if (tuple.negativePrefix != null) { |
266 properties.setNegativePrefix(tuple.negativePrefix); | 319 properties.setNegativePrefix(tuple.negativePrefix); |
267 } | 320 } |
268 if (tuple.negativeSuffix != null) { | 321 if (tuple.negativeSuffix != null) { |
269 properties.setNegativeSuffix(tuple.negativeSuffix); | 322 properties.setNegativeSuffix(tuple.negativeSuffix); |
270 } | 323 } |
271 if (tuple.localizedPattern != null) { | 324 if (tuple.localizedPattern != null) { |
272 // TODO | 325 // TODO |
273 } | 326 } |
274 if (tuple.lenient != null) { | 327 if (tuple.lenient != null) { |
275 properties.setParseMode(tuple.lenient == 0 ? ParseMode.STRICT : ParseMode.
LENIENT); | 328 properties.setParseMode(tuple.lenient == 0 ? ParseMode.STRICT : ParseMode.
LENIENT); |
276 } | 329 } |
277 if (tuple.parseIntegerOnly != null) { | 330 if (tuple.parseIntegerOnly != null) { |
278 properties.setParseIntegerOnly(tuple.parseIntegerOnly != 0); | 331 properties.setParseIntegerOnly(tuple.parseIntegerOnly != 0); |
279 } | 332 } |
| 333 if (tuple.parseCaseSensitive != null) { |
| 334 properties.setParseCaseSensitive(tuple.parseCaseSensitive != 0); |
| 335 } |
280 if (tuple.decimalPatternMatchRequired != null) { | 336 if (tuple.decimalPatternMatchRequired != null) { |
281 // TODO | 337 properties.setDecimalPatternMatchRequired(tuple.decimalPatternMatchRequire
d != 0); |
282 } | 338 } |
283 if (tuple.parseNoExponent != null) { | 339 if (tuple.parseNoExponent != null) { |
284 properties.setParseIgnoreExponent(tuple.parseNoExponent != 0); | 340 properties.setParseNoExponent(tuple.parseNoExponent != 0); |
285 } | 341 } |
286 } | 342 } |
287 } | 343 } |
LEFT | RIGHT |