|
Sharkysoft home | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--lava.clib.Ctype
Ports of ctype functions.
Details: Ctype
is port of the ctype library from the C programming language. By emulating many of the C language's ctype library functions, this class lets die-hard C programmers write Java code without completely converting to the Java API. Rather than wasting valuable time figuring out how to perform the Java equivalent of tasks that are easy in C, the programmer can simply use the methods in this class instead.
This class also contains some additional functions that have similar features.
Method Summary | |
static boolean |
isalnum(int c)
Returns true if c is alphanumeric. |
static boolean |
isalpha(int c)
Returns true if c is a letter. |
static boolean |
isascii(int c)
Returns true if c is any ASCII character. |
static boolean |
iscntrl(int c)
Returns true if c is a control character. |
static boolean |
isdigit(int c)
Returns true if c is a decimal digit. |
static boolean |
isendline(int c)
Returns true if c is an ASCII end-of-line character. |
static boolean |
isgraph(int c)
Returns true if c is a visible character. |
static boolean |
ishspace(int c)
Tests for horizontal space. |
static boolean |
islower(int c)
Returns true if c is a lowercase letter. |
static boolean |
isprint(int c)
Returns true if c is a printing character. |
static boolean |
ispunct(int c)
Returns true if c is a punctuation character. |
static boolean |
isspace(int c)
Returns true if c is a character that creates "white space" in displayed text. |
static boolean |
isupper(int c)
Returns true if c is an uppercase letter. |
static boolean |
isvspace(int c)
Tests for vertical space. |
static boolean |
isxdigit(int c)
Returns true if c is a hexadecimal digit. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Method Detail |
public static boolean isalpha(int c)
true
if c is a letter. Returns the result of Character.isLetter(c)
.public static boolean isupper(int c)
true
if c is an uppercase letter. Returns the result of Character.isUpperCase(c)
.public static boolean islower(int c)
true
if c is a lowercase letter. Returns the result of Character.isLowerCase(c)
.public static boolean isdigit(int c)
true
if c is a decimal digit. Returns the result of Character.isDigit(c)
.public static boolean isxdigit(int c)
true
if c is a hexadecimal digit. True if c is in {0-9, A-F, a-f}.public static boolean isalnum(int c)
true
if c is alphanumeric. Specifically, returns the result of Character.isLetterOrDigit(c)
.public static boolean isspace(int c)
true
if c is a character that creates "white space" in displayed text. Specifically, returns Character.isWhitespace(c)
.public static boolean ispunct(int c)
true
if c is a punctuation character. For ASCII values, a punctuation mark is any printing character except the space character (040), digits, letters. For Unicode values, a punctuation mark is any character in the following classes (see java.lang.Character):
public static boolean isprint(int c)
true
if c is a printing character. For ASCII values, c is a printing character if and only if c is in {32..127}. This method does not support Unicode values, but it may in the future.public static boolean isgraph(int c)
true
if c is a visible character. For ASCII values, c is a printing character if and only if c is in {33..127}. This method does not support Unicode values, but it may in the future.public static boolean iscntrl(int c)
true
if c is a control character. c is a control character if and only if c is in {0..31, 127}. This method does not support Unicode values, but it may in the future.public static boolean isascii(int c)
true
if c is any ASCII character. c is an ASCII character if an only if c is in {0..127}.public static boolean isvspace(int c)
Details: isvspace returns true if the given character (c) is a vertical space. The criteria for determining this is as follows (in order of precedence):
c
- the character to testpublic static boolean ishspace(int c)
Details: ishspace returns true if and only if the given character is a horizontal space. The test is conducted as follows:
There may be other unicode characters that can be considered horizontal spaces. If you discover any, please let the author know and the test will be patched in a future release.
c
- the character to testpublic static boolean isendline(int c)
true
if c is an ASCII end-of-line character. An end-of-line character is one of {'\n', '\r'}.
|
Sharkysoft home | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |