Class Char


  • @Internal
    public abstract class Char
    extends Object
    From editor-wikimarkup-transformer/src/char.ts originally, but there is a lot more in here, now.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static char hex​(int hexit)
      Returns the hexadecimal digit for the given value, which must be in the range [0, 15].
      static boolean isAlnum​(char c)
      Checks for a simple ASCII alphanumeric character, meaning one of the decimal digit '0' through '9', an uppercase unmodified English-language letter 'A' through 'Z', or the same 'a' through 'z' range in lowercase.
      static boolean isAlpha​(char c)
      Checks for a simple ASCII alphabetic character, meaning an uppercase unmodified English-language letter 'A' through 'Z', or the same 'a' through 'z' range in lowercase.
      static boolean isDigit​(char c)
      Checks for a simple ASCII digit, meaning a decimal digit '0' through '9'.
      static boolean isHexit​(char c)
      Checks for a simple ASCII hexadecimal digit, meaning a decimal digit '0' through '9' or one of the letters 'A' through 'F' (allowing both uppercase or lowercase).
      static boolean isLineTerminator​(char c)
      Checks whether the given character is a line terminator in the sense of what matches the . character in a non-multiline regex.
      static boolean isLower​(char c)
      Checks for a simple ASCII lowercase letter, meaning 'a' through 'z'.
      static boolean isSpace​(char c)
      Checks for a simple ASCII whitespace character as defined by the \s character class in regular expression patterns.
      static boolean isUpper​(char c)
      Checks for a simple ASCII uppercase letter, meaning 'A' through 'Z'.
    • Method Detail

      • isAlpha

        public static boolean isAlpha​(char c)
        Checks for a simple ASCII alphabetic character, meaning an uppercase unmodified English-language letter 'A' through 'Z', or the same 'a' through 'z' range in lowercase.
        Parameters:
        c - the character to consider
        Returns:
        true if the character is a simple ASCII alphanumeric; false if it is anything else
      • isAlnum

        public static boolean isAlnum​(char c)
        Checks for a simple ASCII alphanumeric character, meaning one of the decimal digit '0' through '9', an uppercase unmodified English-language letter 'A' through 'Z', or the same 'a' through 'z' range in lowercase.
        Parameters:
        c - the character to consider
        Returns:
        true if the character is a simple ASCII alphanumeric; false if it is anything else
      • isHexit

        public static boolean isHexit​(char c)
        Checks for a simple ASCII hexadecimal digit, meaning a decimal digit '0' through '9' or one of the letters 'A' through 'F' (allowing both uppercase or lowercase).
        Parameters:
        c - the character to consider
        Returns:
        true if the character is a simple ASCII hex digit; false if it is anything else
      • isDigit

        public static boolean isDigit​(char c)
        Checks for a simple ASCII digit, meaning a decimal digit '0' through '9'.
        Parameters:
        c - the character to consider
        Returns:
        true if the character is a simple ASCII digit; false if it is anything else
      • isUpper

        public static boolean isUpper​(char c)
        Checks for a simple ASCII uppercase letter, meaning 'A' through 'Z'.
        Parameters:
        c - the character to consider
        Returns:
        true if the character is a simple ASCII uppercase letter; false if it is anything else
      • isLower

        public static boolean isLower​(char c)
        Checks for a simple ASCII lowercase letter, meaning 'a' through 'z'.
        Parameters:
        c - the character to consider
        Returns:
        true if the character is a simple ASCII lowercase letter; false if it is anything else
      • isSpace

        public static boolean isSpace​(char c)
        Checks for a simple ASCII whitespace character as defined by the \s character class in regular expression patterns.
        Parameters:
        c - the character to consider
        Returns:
        true if the character matches the character class \s, which is equivalent to [ \t\n\x0B\f\r].
      • isLineTerminator

        public static boolean isLineTerminator​(char c)
        Checks whether the given character is a line terminator in the sense of what matches the . character in a non-multiline regex.
        Parameters:
        c - the character to consider
        Returns:
        true if the character matches the character class, which includes any of the characters U+000A, U+000D, U+0085, U+2028, or U+2029.
      • hex

        public static char hex​(int hexit)
        Returns the hexadecimal digit for the given value, which must be in the range [0, 15]. For the values in the range [10, 15], uppercase letters are used.
        Parameters:
        hexit - the value to represent as a hex digit
        Returns:
        the character that represents it, using uppercase for any letters
        Throws:
        IndexOutOfBoundsException - if hexit is out of the accepted range