Class Alphanumeric


  • public class Alphanumeric
    extends java.lang.Object
    This class contains static utility methods to test whether a character is alphanumeric, as defined by the rules of xsl:number: that is, whether it is in one of the Unicode categories Nd, Nl, No, Lu, Ll, Lt, Lm or Lo In Saxon 9.9 the data has been regenerated from Unicode 10.0.0.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static int getDigitFamily​(int in)
      Determine which digit family a decimal digit belongs to: that is, return the corresponding zero digit.
      static int getDigitValue​(int in)
      Determine whether a character represents a decimal digit and if so, which digit.
      static boolean isAlphanumeric​(int codepoint)
      Determine whether a Unicode codepoint is alphanumeric, that is, whether it is in one of the categories Nd, Nl, No, Lu, Ll, Lt, Lm or Lo
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • isAlphanumeric

        public static boolean isAlphanumeric​(int codepoint)
        Determine whether a Unicode codepoint is alphanumeric, that is, whether it is in one of the categories Nd, Nl, No, Lu, Ll, Lt, Lm or Lo
        Parameters:
        codepoint - the codepoint to be tested
        Returns:
        true if the codepoint is in one of these categories
      • getDigitValue

        public static int getDigitValue​(int in)
        Determine whether a character represents a decimal digit and if so, which digit.
        Parameters:
        in - the Unicode character being tested.
        Returns:
        -1 if it's not a decimal digit, otherwise the digit value.
      • getDigitFamily

        public static int getDigitFamily​(int in)
        Determine which digit family a decimal digit belongs to: that is, return the corresponding zero digit.
        Parameters:
        in - a Unicode character
        Returns:
        if the character is a digit, return the Unicode character that represents zero in the same digit family. Otherwise, return -1.