aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas L. Delmelle <adelmelle@apache.org>2008-06-22 22:17:00 +0000
committerAndreas L. Delmelle <adelmelle@apache.org>2008-06-22 22:17:00 +0000
commitd617099c1d581634a9e8bd4bc4ab27ae4b1f6ace (patch)
tree6655244dbf6543b3678fbff1d135fe6aa2ddf3c5
parent07c5dcf7162f75c1c176d67df52bf0c50f462f78 (diff)
downloadxmlgraphics-fop-d617099c1d581634a9e8bd4bc4ab27ae4b1f6ace.tar.gz
xmlgraphics-fop-d617099c1d581634a9e8bd4bc4ab27ae4b1f6ace.zip
Added missing file from r670422
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@670423 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--src/java/org/apache/fop/util/CharUtilities.java24
1 files changed, 19 insertions, 5 deletions
diff --git a/src/java/org/apache/fop/util/CharUtilities.java b/src/java/org/apache/fop/util/CharUtilities.java
index 6baa5c0fd..eb56cd331 100644
--- a/src/java/org/apache/fop/util/CharUtilities.java
+++ b/src/java/org/apache/fop/util/CharUtilities.java
@@ -54,10 +54,14 @@ public class CharUtilities {
public static final int XMLWHITESPACE = 4;
+ /** null char */
+ public static final char NULL_CHAR = '\u0000';
/** linefeed character */
public static final char LINEFEED_CHAR = '\n';
/** carriage return */
public static final char CARRIAGE_RETURN = '\r';
+ /** normal tab */
+ public static final char TAB = '\t';
/** normal space */
public static final char SPACE = '\u0020';
/** non-breaking space */
@@ -80,9 +84,12 @@ public class CharUtilities {
public static final char PARAGRAPH_SEPARATOR = '\u2029';
/** missing ideograph */
public static final char MISSING_IDEOGRAPH = '\u25A1';
+ /** Ideogreaphic space */
+ public static final char IDEOGRAPHIC_SPACE = '\u3000';
/** Unicode value indicating the the character is "not a character". */
public static final char NOT_A_CHARACTER = '\uFFFF';
+
/**
* Utility class: Constructor prevents instantiating when subclassed.
*/
@@ -97,11 +104,18 @@ public class CharUtilities {
* @return the determined character class
*/
public static int classOf(char c) {
- if (c == CODE_EOT) { return EOT; }
- if (c == '\n') { return LINEFEED; }
- if (c == ' ' || c == '\r' || c == '\t') { return XMLWHITESPACE; }
- if (isAnySpace(c)) { return UCWHITESPACE; }
- return NONWHITESPACE;
+ switch (c) {
+ case CODE_EOT:
+ return EOT;
+ case LINEFEED_CHAR:
+ return LINEFEED;
+ case SPACE:
+ case CARRIAGE_RETURN:
+ case TAB:
+ return XMLWHITESPACE;
+ default:
+ return isAnySpace(c) ? UCWHITESPACE : NONWHITESPACE;
+ }
}