java.lang.Object
com.maroontress.clione.impl.Chars
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
Modifier and TypeFieldDescriptionA character set containing only delimiters.A character set containing only digits.A character set containing only delimiters inside a directive.A set of characters which can be the first character of an identifier.A set of characters which an identifier can contain. -
Method Summary
Modifier and TypeMethodDescriptionstatic 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
isDirectiveDelimiter
(char c) 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
isNumberSuffix
(char c) 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
isPreprocessingNumber
(char c) Determines if the specified character composes a preprocessing number (except'+'
and'-'
following eithere
orE
).
-
Field Details
-
DIGIT_SET
A character set containing only digits. -
DIRECTIVE_DELIMITER_SET
A character set containing only delimiters inside a directive. -
DELIMITER_SET
A character set containing only delimiters. -
FIRST_OF_IDENTIFIER_SET
A set of characters which can be the first character of an identifier. -
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 eithere
orE
).- 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.
-