From ba446e8b7957111264c43f2bc00a361ba3f3e8bf Mon Sep 17 00:00:00 2001 From: Syn Wee Quek Date: Thu, 4 Apr 2002 22:38:13 +0000 Subject: [PATCH] ICU-1586 Synching with Java's properties X-SVN-Rev: 8381 --- icu4j/src/com/ibm/icu/lang/UCharacter.java | 51 ++++++++++++---------- 1 file changed, 29 insertions(+), 22 deletions(-) diff --git a/icu4j/src/com/ibm/icu/lang/UCharacter.java b/icu4j/src/com/ibm/icu/lang/UCharacter.java index cb6b8e2255..ba092ea61e 100755 --- a/icu4j/src/com/ibm/icu/lang/UCharacter.java +++ b/icu4j/src/com/ibm/icu/lang/UCharacter.java @@ -5,8 +5,8 @@ ******************************************************************************* * * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/icu/lang/UCharacter.java,v $ -* $Date: 2002/04/04 00:52:40 $ -* $Revision: 1.37 $ +* $Date: 2002/04/04 22:38:13 $ +* $Revision: 1.38 $ * ******************************************************************************* */ @@ -338,7 +338,17 @@ public final class UCharacter * a no-break space (\u00A0 or \u202F or \uFEFF). *
  • It is a Unicode line separator (category "Zl"). *
  • It is a Unicode paragraph separator (category "Zp"). + *
  • It is \u0009, HORIZONTAL TABULATION. + *
  • It is \u000A, LINE FEED. + *
  • It is \u000B, VERTICAL TABULATION. + *
  • It is \u000C, FORM FEED. + *
  • It is \u000D, CARRIAGE RETURN. + *
  • It is \u001C, FILE SEPARATOR. + *
  • It is \u001D, GROUP SEPARATOR. + *
  • It is \u001E, RECORD SEPARATOR. + *
  • It is \u001F, UNIT SEPARATOR. * + * * Up-to-date Unicode implementation of java.lang.Character.isWhitespace(). * @param ch code point to determine if it is a white space * @return true if the specified code point is a white space character @@ -356,8 +366,7 @@ public final class UCharacter (ch != ZERO_WIDTH_NO_BREAK_SPACE_) || // TAB VT LF FF CR FS GS RS US NL are all control characters // that are white spaces. - (ch >= 0x9 && ch <= 0xd) || (ch >= 0x1c && ch <= 0x1f) || - (ch == 0x85); + (ch >= 0x9 && ch <= 0xd) || (ch >= 0x1c && ch <= 0x1f); } /** @@ -373,11 +382,7 @@ public final class UCharacter // if props == 0, it will just fall through and return false return cat == UCharacterCategory.SPACE_SEPARATOR || cat == UCharacterCategory.LINE_SEPARATOR || - cat == UCharacterCategory.PARAGRAPH_SEPARATOR || - // TAB VT LF FF CR FS GS RS US NL are all control characters - // that are white spaces. - (ch >= 0x9 && ch <= 0xd) || (ch >= 0x1c && ch <= 0x1f) || - (ch == 0x85); + cat == UCharacterCategory.PARAGRAPH_SEPARATOR; } /** @@ -1797,29 +1802,31 @@ public final class UCharacter int numericType = UCharacterProperty.getNumericType(props); int result = -1; + if (numericType == UCharacterProperty.NON_DIGIT_NUMERIC_TYPE_) { + result = -2; + } if (numericType != UCharacterProperty.NON_NUMERIC_TYPE_) { // if props == 0, it will just fall through and return -1 - if (numericType == UCharacterProperty.NON_DIGIT_NUMERIC_TYPE_ - /* && PROPERTY_.hasExceptionValue(index, - UCharacterProperty.EXC_DENOMINATOR_VALUE_)*/) { - return -2; - } if (!UCharacterProperty.isExceptionIndicator(props)) { // not contained in exception data - result = UCharacterProperty.getSignedValue(props); + return UCharacterProperty.getSignedValue(props); } - else { - int index = UCharacterProperty.getExceptionIndex(props); - if (PROPERTY_.hasExceptionValue(index, + + int index = UCharacterProperty.getExceptionIndex(props); + if (!PROPERTY_.hasExceptionValue(index, + UCharacterProperty.EXC_DENOMINATOR_VALUE_) && + PROPERTY_.hasExceptionValue(index, UCharacterProperty.EXC_NUMERIC_VALUE_)) { - result = PROPERTY_.getException(index, - UCharacterProperty.EXC_NUMERIC_VALUE_); - } + return PROPERTY_.getException(index, + UCharacterProperty.EXC_NUMERIC_VALUE_); } } if (result < 0 && useEuropean) { - result = getEuropeanDigit(ch); + int europeannumeric = getEuropeanDigit(ch); + if (europeannumeric >= 0) { + return europeannumeric; + } } return result;