/**
* Determines if the specified character (Unicode code point) is a digit.
* <p>
* A character is a digit if its general category type, provided
* by {@link Character#getType(int) getType(codePoint)}, is
* <code>DECIMAL_DIGIT_NUMBER</code>.
* <p>
* Some Unicode character ranges that contain digits:
* <ul>
* <li><code>'\u0030'</code> through <code>'\u0039'</code>,
* ISO-LATIN-1 digits (<code>'0'</code> through <code>'9'</code>)
* <li><code>'\u0660'</code> through <code>'\u0669'</code>,
* Arabic-Indic digits
* <li><code>'\u06F0'</code> through <code>'\u06F9'</code>,
* Extended Arabic-Indic digits
* <li><code>'\u0966'</code> through <code>'\u096F'</code>,
* Devanagari digits
* <li><code>'\uFF10'</code> through <code>'\uFF19'</code>,
* Fullwidth digits
* </ul>
*
* Many other character ranges contain digits as well.
*
* @param codePoint the character (Unicode code point) to be tested.
* @return <code>true</code> if the character is a digit;
* <code>false</code> otherwise.
* @see java.lang.Character#forDigit(int, int)
* @see java.lang.Character#getType(int)
* @since 1.5
*/
public static boolean isDigit(int codePoint) {
boolean bDigit = false;
if (codePoint >= MIN_CODE_POINT && codePoint <= FAST_PATH_MAX) {
bDigit = CharacterDataLatin1.isDigit(codePoint);
} else {
int plane = getPlane(codePoint);
switch(plane) {
case(0):
bDigit = CharacterData00.isDigit(codePoint);
break;
case(1):
bDigit = CharacterData01.isDigit(codePoint);
break;
case(2):
bDigit = CharacterData02.isDigit(codePoint);
break;
case(3): // Undefined
case(4): // Undefined
case(5): // Undefined
case(6): // Undefined
case(7): // Undefined
case(8): // Undefined
case(9): // Undefined
case(10): // Undefined
case(11): // Undefined
case(12): // Undefined
case(13): // Undefined
bDigit = CharacterDataUndefined.isDigit(codePoint);
break;
case(14):
bDigit = CharacterData0E.isDigit(codePoint);
break;
case(15): // Private Use
case(16): // Private Use
bDigit = CharacterDataPrivateUse.isDigit(codePoint);
break;
default:
// the argument's plane is invalid, and thus is an invalid codepoint
// bDigit remains false;
break;
}
}
return bDigit;
}