java.lang.Object
com.maroontress.clione.impl.Chars

public final class Chars extends Object
Provides immutable Set objects of a character and utility methods for determining a character's category (that is letter, digit, and so on).
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final Set<Character>
    A character set containing only delimiters.
    static final Set<Character>
    A character set containing only digits.
    static final Set<Character>
    A character set containing only delimiters inside a directive.
    static final Set<Character>
    A set of characters which can be the first character of an identifier.
    static final Set<Character>
    A set of characters which an identifier can contain.
  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    isDelimiter(char c)
    Determines if the specified character is a delimiter.
    static boolean
    isDigit(char c)
    Determines if the specified character is a digit ([0-9]).
    static boolean
    Determines if the specified character is a delimiter inside a directive.
    static boolean
    isFirstName(char c)
    Determines if the specified character may be the first character in an identifier (except Universal Character Names and other implementation-defined characters).
    static boolean
    isHexDigit(char c)
    Determines if the specified character is a hexadecimal digit ([0-9a-fA-F]).
    static boolean
    isName(char c)
    Determines if the specified character may be part of an identifier as other than the first character (except Universal Character Names and other implementation-defined characters).
    static boolean
    Determines if the specified character may be part of a number suffix.
    static boolean
    isOctalDigit(char c)
    Determines if the specified character is an octal digit ([0-7]).
    static boolean
    Determines if the specified character composes a preprocessing number (except '+' and '-' following either e or E).

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • DIGIT_SET

      public static final Set<Character> DIGIT_SET
      A character set containing only digits.
    • DIRECTIVE_DELIMITER_SET

      public static final Set<Character> DIRECTIVE_DELIMITER_SET
      A character set containing only delimiters inside a directive.
    • DELIMITER_SET

      public static final Set<Character> DELIMITER_SET
      A character set containing only delimiters.
    • FIRST_OF_IDENTIFIER_SET

      public static final Set<Character> FIRST_OF_IDENTIFIER_SET
      A set of characters which can be the first character of an identifier.
    • IDENTIFIER_SET

      public static final Set<Character> IDENTIFIER_SET
      A set of characters which an identifier can contain. Note that this does not contain Unicode non-digit characters.
  • Method Details

    • isDirectiveDelimiter

      public static boolean isDirectiveDelimiter(char c)
      Determines if the specified character is a delimiter inside a directive.
      Parameters:
      c - The character to be tested.
      Returns:
      true if the character is a delimiter inside a directive.
    • isDelimiter

      public static boolean isDelimiter(char c)
      Determines if the specified character is a delimiter.
      Parameters:
      c - The character to be tested.
      Returns:
      true if the character is a delimiter.
    • isPreprocessingNumber

      public static boolean isPreprocessingNumber(char c)
      Determines if the specified character composes a preprocessing number (except '+' and '-' following either e or E).
      Parameters:
      c - The character to be tested.
      Returns:
      true if the character is composes a preprocessing number.
    • isDigit

      public static boolean isDigit(char c)
      Determines if the specified character is a digit ([0-9]).
      Parameters:
      c - The character to be tested.
      Returns:
      true if the character is a digit.
    • isNumberSuffix

      public static boolean isNumberSuffix(char c)
      Determines if the specified character may be part of a number suffix. ([uUlL]).
      Parameters:
      c - The character to be tested.
      Returns:
      true if the character be part of a number suffix.
    • isHexDigit

      public static boolean isHexDigit(char c)
      Determines if the specified character is a hexadecimal digit ([0-9a-fA-F]).
      Parameters:
      c - The character to be tested.
      Returns:
      true if the character is a hexadecimal digit.
    • isOctalDigit

      public static boolean isOctalDigit(char c)
      Determines if the specified character is an octal digit ([0-7]).
      Parameters:
      c - The character to be tested.
      Returns:
      true if the character is an octal digit.
    • isFirstName

      public static boolean isFirstName(char c)
      Determines if the specified character may be the first character in an identifier (except Universal Character Names and other implementation-defined characters).
      Parameters:
      c - The character to be tested.
      Returns:
      true if the character may start an identifier.
    • isName

      public static boolean isName(char c)
      Determines if the specified character may be part of an identifier as other than the first character (except Universal Character Names and other implementation-defined characters).
      Parameters:
      c - The character to be tested.
      Returns:
      true if the character be part of an identifier.