public final class CharacterTools
extends java.lang.Object
Note:
This class deliberately avoids using the built-in Character methods
(like isWhitespace or isJavaIdentifierPart). The standard Java methods
evaluate the entire Unicode spectrum, which introduces risks in a parser pipeline:
| Modifier and Type | Method and Description |
|---|---|
static boolean |
isAsciiDigit(char c)
Evaluates if a character is a standard ASCII digit (0-9).
|
static boolean |
isAsciiIdentifierPart(char c)
Evaluates if a character is a valid, strict ASCII continuing character for an OQL identifier.
|
static boolean |
isAsciiIdentifierStart(char c)
Evaluates if a character is a valid, strict ASCII starting character for an OQL identifier.
|
static boolean |
isAsciiWhitespace(char c)
Evaluates if a character is standard ASCII whitespace.
|
static byte |
toByte(char c)
Fast primitive coercion from char to byte.
|
static char |
toChar(byte b)
Fast primitive coercion from byte to char.
|
static char |
toChar(int i)
Fast primitive coercion from integer to char.
|
static int |
toInt(char c)
Fast primitive coercion from char to integer.
|
public static boolean isAsciiDigit(char c)
c - the character to evaluatepublic static boolean isAsciiWhitespace(char c)
c - the character to evaluatepublic static boolean isAsciiIdentifierStart(char c)
c - the character to evaluatepublic static boolean isAsciiIdentifierPart(char c)
c - the character to evaluatepublic static char toChar(byte b)
b - the byte to coercepublic static char toChar(int i)
i - the integer to coercepublic static byte toByte(char c)
Note: This causes data loss for characters outside the 8-bit range!
c - the character to coercepublic static int toInt(char c)
c - the character to coerceCopyright © 2000-2026 OAshi S.à r.l. All Rights Reserved.