ICU-1997 isRuleWhiteSpace (sigh)

X-SVN-Rev: 9382
This commit is contained in:
Doug Felt 2002-07-26 22:51:50 +00:00
parent 649057f2f3
commit 1d3acd2f52
3 changed files with 20 additions and 15 deletions

View File

@ -5,20 +5,22 @@
*******************************************************************************
*
* $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/icu/text/NFRule.java,v $
* $Date: 2002/02/16 03:06:09 $
* $Revision: 1.4 $
* $Date: 2002/07/26 22:51:50 $
* $Revision: 1.5 $
*
*****************************************************************************************
*/
package com.ibm.icu.text;
import com.ibm.icu.impl.UCharacterProperty;
import java.text.*;
/**
* A class represnting a single rule in a RuleBasedNumberFormat. A rule
* inserts its text into the result string and then passes control to its
* substitutions, which do the same thing.
* $RCSfile: NFRule.java,v $ $Revision: 1.4 $ $Date: 2002/02/16 03:06:09 $
* $RCSfile: NFRule.java,v $ $Revision: 1.5 $ $Date: 2002/07/26 22:51:50 $
*/
final class NFRule {
//-----------------------------------------------------------------------
@ -253,7 +255,7 @@ final class NFRule {
// description
descriptor = description.substring(0, p);
++p;
while (p < description.length() && Character.isWhitespace(description.charAt(p)))
while (p < description.length() && UCharacterProperty.isRuleWhiteSpace(description.charAt(p)))
++p;
description = description.substring(p);
@ -292,7 +294,7 @@ final class NFRule {
else if (c == '/' || c == '>') {
break;
}
else if (Character.isWhitespace(c) || c == ',' || c == '.') {
else if (UCharacterProperty.isRuleWhiteSpace(c) || c == ',' || c == '.') {
}
else {
throw new IllegalArgumentException("Illegal character in rule descriptor");
@ -320,7 +322,7 @@ final class NFRule {
else if (c == '>') {
break;
}
else if (Character.isWhitespace(c) || c == ',' || c == '.') {
else if (UCharacterProperty.isRuleWhiteSpace(c) || c == ',' || c == '.') {
}
else {
throw new IllegalArgumentException("Illegal character is rule descriptor");

View File

@ -5,13 +5,15 @@
*******************************************************************************
*
* $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/icu/text/NFRuleSet.java,v $
* $Date: 2002/02/16 03:06:09 $
* $Revision: 1.3 $
* $Date: 2002/07/26 22:51:50 $
* $Revision: 1.4 $
*
*****************************************************************************************
*/
package com.ibm.icu.text;
import com.ibm.icu.impl.UCharacterProperty;
import java.text.*;
import java.util.Vector;
@ -21,7 +23,7 @@ import java.util.Vector;
* appropriate rule for formatting a particular number and dispatch
* control to it, and to arbitrate between different rules when parsing
* a number.
* $RCSfile: NFRuleSet.java,v $ $Revision: 1.3 $ $Date: 2002/02/16 03:06:09 $
* $RCSfile: NFRuleSet.java,v $ $Revision: 1.4 $ $Date: 2002/07/26 22:51:50 $
*/
final class NFRuleSet {
//-----------------------------------------------------------------------
@ -95,7 +97,7 @@ final class NFRuleSet {
throw new IllegalArgumentException("Rule set name doesn't end in colon");
} else {
name = description.substring(0, pos);
while (pos < description.length() && Character.isWhitespace(description.
while (pos < description.length() && UCharacterProperty.isRuleWhiteSpace(description.
charAt(++pos))) {
}
description = description.substring(pos);

View File

@ -5,8 +5,8 @@
*******************************************************************************
*
* $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/icu/text/RuleBasedNumberFormat.java,v $
* $Date: 2002/07/13 01:36:45 $
* $Revision: 1.8 $
* $Date: 2002/07/26 22:51:49 $
* $Revision: 1.9 $
*
*****************************************************************************************
*/
@ -14,6 +14,7 @@
package com.ibm.icu.text;
import com.ibm.icu.impl.ICULocaleData;
import com.ibm.icu.impl.UCharacterProperty;
import java.math.BigInteger;
import java.text.FieldPosition;
@ -471,7 +472,7 @@ import java.util.Vector;
* using these features.</p>
*
* @author Richard Gillam
* $RCSfile: RuleBasedNumberFormat.java,v $ $Revision: 1.8 $ $Date: 2002/07/13 01:36:45 $
* $RCSfile: RuleBasedNumberFormat.java,v $ $Revision: 1.9 $ $Date: 2002/07/26 22:51:49 $
* @see NumberFormat
* @see DecimalFormat
*/
@ -1109,7 +1110,7 @@ public final class RuleBasedNumberFormat extends NumberFormat {
lpEnd = description.length() - 1;
}
int lpStart = lp + "%%lenient-parse:".length();
while (Character.isWhitespace(description.charAt(lpStart))) {
while (UCharacterProperty.isRuleWhiteSpace(description.charAt(lpStart))) {
++lpStart;
}
@ -1191,7 +1192,7 @@ public final class RuleBasedNumberFormat extends NumberFormat {
while (start != -1 && start < description.length()) {
// seek to the first non-whitespace character...
while (start < description.length()
&& Character.isWhitespace(description.charAt(start))) {
&& UCharacterProperty.isRuleWhiteSpace(description.charAt(start))) {
++start;
}