make/data/characterdata/CharacterData0E.java.template

Print this page


   1 /*
   2  * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


 198     int getNumericValue(int ch) {
 199         int val = getProperties(ch);
 200         int retval = -1;
 201 
 202         switch (val & $$maskNumericType) {
 203         default: // cannot occur
 204         case ($$valueNotNumeric):         // not numeric
 205             retval = -1;
 206             break;
 207         case ($$valueDigit):              // simple numeric
 208             retval = ch + ((val & $$maskDigitOffset) >> $$shiftDigitOffset) & $$maskDigit;
 209             break;
 210         case ($$valueStrangeNumeric)      :       // "strange" numeric
 211             retval = -2;
 212             break;
 213         case ($$valueJavaSupradecimal):           // Java supradecimal
 214             retval = (ch + ((val & $$maskDigitOffset) >> $$shiftDigitOffset) & $$maskDigit) + 10;
 215             break;
 216         }
 217         return retval;












 218     }
 219 
 220     boolean isWhitespace(int ch) {
 221         int props = getProperties(ch);
 222         return ((props & $$maskIdentifierInfo) == $$valueJavaWhitespace);
 223     }
 224 
 225     byte getDirectionality(int ch) {
 226         int val = getProperties(ch);
 227         byte directionality = (byte)((val & $$maskBidi) >> $$shiftBidi);
 228         if (directionality == 0xF ) {
 229                 directionality = Character.DIRECTIONALITY_UNDEFINED;
 230         }
 231         return directionality;
 232     }
 233 
 234     boolean isMirrored(int ch) {
 235         int props = getProperties(ch);
 236         return ((props & $$maskMirrored) != 0);
 237     }
   1 /*
   2  * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


 198     int getNumericValue(int ch) {
 199         int val = getProperties(ch);
 200         int retval = -1;
 201 
 202         switch (val & $$maskNumericType) {
 203         default: // cannot occur
 204         case ($$valueNotNumeric):         // not numeric
 205             retval = -1;
 206             break;
 207         case ($$valueDigit):              // simple numeric
 208             retval = ch + ((val & $$maskDigitOffset) >> $$shiftDigitOffset) & $$maskDigit;
 209             break;
 210         case ($$valueStrangeNumeric)      :       // "strange" numeric
 211             retval = -2;
 212             break;
 213         case ($$valueJavaSupradecimal):           // Java supradecimal
 214             retval = (ch + ((val & $$maskDigitOffset) >> $$shiftDigitOffset) & $$maskDigit) + 10;
 215             break;
 216         }
 217         return retval;
 218     }
 219 
 220     boolean isDigit(int ch) {
 221         return getType(ch) == Character.DECIMAL_DIGIT_NUMBER;
 222     }
 223 
 224     boolean isLowerCase(int ch) {
 225         return getType(ch) == Character.LOWERCASE_LETTER;
 226     }
 227 
 228     boolean isUpperCase(int ch) {
 229         return getType(ch) == Character.UPPERCASE_LETTER;
 230     }
 231 
 232     boolean isWhitespace(int ch) {
 233         int props = getProperties(ch);
 234         return ((props & $$maskIdentifierInfo) == $$valueJavaWhitespace);
 235     }
 236 
 237     byte getDirectionality(int ch) {
 238         int val = getProperties(ch);
 239         byte directionality = (byte)((val & $$maskBidi) >> $$shiftBidi);
 240         if (directionality == 0xF ) {
 241                 directionality = Character.DIRECTIONALITY_UNDEFINED;
 242         }
 243         return directionality;
 244     }
 245 
 246     boolean isMirrored(int ch) {
 247         int props = getProperties(ch);
 248         return ((props & $$maskMirrored) != 0);
 249     }