CharacterData0E.java.template revision 0
0N/A * Copyright 2003-2006 Sun Microsystems, Inc. All Rights Reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 0N/A * published by the Free Software Foundation. Sun designates this 0N/A * particular file as subject to the "Classpath" exception as provided 0N/A * by Sun in the LICENSE file that accompanied this code. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 0N/A * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 0N/A * CA 95054 USA or visit www.sun.com if you need additional information or 0N/A * have any questions. 0N/A/** The CharacterData class encapsulates the large tables found in 0N/A Java.lang.Character. */ 0N/A /* The character properties are currently encoded into 32 bits in the following manner: 0N/A 1 bit mirrored property 0N/A 4 bits directionality property 0N/A 9 bits signed offset used for converting case 0N/A 1 bit if 1, adding the signed offset converts the character to lowercase 0N/A 1 bit if 1, subtracting the signed offset converts the character to uppercase 0N/A 1 bit if 1, this character has a titlecase equivalent (possibly itself) 0N/A 3 bits 0 may not be part of an identifier 0N/A 1 ignorable control; may continue a Unicode identifier or Java identifier 0N/A 2 may continue a Java identifier but not a Unicode identifier (unused) 0N/A 3 may continue a Unicode identifier or Java identifier 0N/A 4 is a Java whitespace character 0N/A 5 may start or continue a Java identifier; 0N/A may continue but not start a Unicode identifier (underscores) 0N/A 6 may start or continue a Java identifier but not a Unicode identifier ($) 0N/A 7 may start or continue a Unicode identifier or Java identifier 0N/A 5, 6, 7 may start a Java identifier 0N/A 1, 2, 3, 5, 6, 7 may continue a Java identifier 0N/A 7 may start a Unicode identifier 0N/A 1, 3, 5, 7 may continue a Unicode identifier 0N/A 1 is ignorable within an identifier 0N/A 4 is Java whitespace 0N/A 2 bits 0 this character has no numeric property 0N/A 1 adding the digit offset to the character code and then 0N/A masking with 0x1F will produce the desired numeric value 0N/A 2 this character has a "strange" numeric value 0N/A 3 a Java supradecimal digit: adding the digit offset to the 0N/A character code, then masking with 0x1F, then adding 10 0N/A will produce the desired numeric value 0N/A 5 bits character type 0N/A The encoding of character properties is subject to change at any time. 0N/A // There is a titlecase equivalent. Perform further checks: 0N/A // The character does not have an uppercase equivalent, so it must 0N/A // already be uppercase; so add 1 to get the titlecase form. 0N/A // The character does not have a lowercase equivalent, so it must 0N/A // already be lowercase; so subtract 1 to get the titlecase form. 0N/A // The character has both an uppercase equivalent and a lowercase 0N/A // equivalent, so it must itself be a titlecase form; return it. 0N/A // This character has no titlecase equivalent but it does have an 0N/A // uppercase equivalent, so use that (subtract the signed case offset). 0N/A // Java supradecimal digit 0N/A default:
// cannot occur