From 911da04bffaeefd5340d0b46a4e6c4a2eb50455a Mon Sep 17 00:00:00 2001 From: Syn Wee Quek Date: Mon, 22 Jul 2002 20:41:10 +0000 Subject: [PATCH] ICU-1997 add functions for "ICU rule white space" - Cf+White_Space X-SVN-Rev: 9281 --- .../com/ibm/icu/impl/UCharacterProperty.java | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/icu4j/src/com/ibm/icu/impl/UCharacterProperty.java b/icu4j/src/com/ibm/icu/impl/UCharacterProperty.java index cf3b3eb7d9b..ea7c89d85cb 100644 --- a/icu4j/src/com/ibm/icu/impl/UCharacterProperty.java +++ b/icu4j/src/com/ibm/icu/impl/UCharacterProperty.java @@ -6,8 +6,8 @@ * * $Source: * /usr/cvs/icu4j/icu4j/src/com/ibm/icu/text/UCharacterPropertyDB.java $ -* $Date: 2002/07/19 00:53:02 $ -* $Revision: 1.12 $ +* $Date: 2002/07/22 20:41:10 $ +* $Revision: 1.13 $ * ******************************************************************************* */ @@ -1355,6 +1355,20 @@ public final class UCharacterProperty implements Trie.DataManipulate } } } + + /** + * Checks if the argument c is to be treated as a white space in ICU + * rules. Usually ICU rule white spaces are ignored unless quoted. + * @param c codepoint to check + * @return true if c is a ICU white space + */ + public static boolean isRuleWhiteSpace(int c) + { + // "white space" in the sense of ICU rule parsers: Cf+White_Space + UCharacterProperty property = UCharacterProperty.getInstance(); + return property.getType(c) == UCharacterCategory.FORMAT || + property.hasBinaryProperty(c, UProperty.WHITE_SPACE); + } // protected variables -----------------------------------------------