equal
deleted
inserted
replaced
304 |
304 |
305 //----------------------------------------------------------------------- |
305 //----------------------------------------------------------------------- |
306 /** |
306 /** |
307 * Changes the parse style to be strict for the remainder of the formatter. |
307 * Changes the parse style to be strict for the remainder of the formatter. |
308 * <p> |
308 * <p> |
309 * Parsing can be strict or lenient - by default its strict. |
309 * Parsing can be strict or lenient - by default it is strict. |
310 * This controls the degree of flexibility in matching the text and sign styles. |
310 * This controls the degree of flexibility in matching the text and sign styles. |
311 * <p> |
311 * <p> |
312 * When used, this method changes the parsing to be strict from this point onwards. |
312 * When used, this method changes the parsing to be strict from this point onwards. |
313 * As strict is the default, this is normally only needed after calling {@link #parseLenient()}. |
313 * As strict is the default, this is normally only needed after calling {@link #parseLenient()}. |
314 * The change will remain in force until the end of the formatter that is eventually |
314 * The change will remain in force until the end of the formatter that is eventually |
323 |
323 |
324 /** |
324 /** |
325 * Changes the parse style to be lenient for the remainder of the formatter. |
325 * Changes the parse style to be lenient for the remainder of the formatter. |
326 * Note that case sensitivity is set separately to this method. |
326 * Note that case sensitivity is set separately to this method. |
327 * <p> |
327 * <p> |
328 * Parsing can be strict or lenient - by default its strict. |
328 * Parsing can be strict or lenient - by default it is strict. |
329 * This controls the degree of flexibility in matching the text and sign styles. |
329 * This controls the degree of flexibility in matching the text and sign styles. |
330 * Applications calling this method should typically also call {@link #parseCaseInsensitive()}. |
330 * Applications calling this method should typically also call {@link #parseCaseInsensitive()}. |
331 * <p> |
331 * <p> |
332 * When used, this method changes the parsing to be lenient from this point onwards. |
332 * When used, this method changes the parsing to be lenient from this point onwards. |
333 * The change will remain in force until the end of the formatter that is eventually |
333 * The change will remain in force until the end of the formatter that is eventually |
3198 int pos = position; |
3198 int pos = position; |
3199 while (pos < maxEndPos) { |
3199 while (pos < maxEndPos) { |
3200 char ch = text.charAt(pos++); |
3200 char ch = text.charAt(pos++); |
3201 int digit = context.getDecimalStyle().convertToDigit(ch); |
3201 int digit = context.getDecimalStyle().convertToDigit(ch); |
3202 if (digit < 0) { |
3202 if (digit < 0) { |
3203 if (pos < minEndPos) { |
3203 if (pos <= minEndPos) { |
3204 return ~position; // need at least min width digits |
3204 return ~position; // need at least min width digits |
3205 } |
3205 } |
3206 pos--; |
3206 pos--; |
3207 break; |
3207 break; |
3208 } |
3208 } |