mirror of
https://github.com/corda/corda.git
synced 2025-06-11 20:01:46 +00:00
Merge pull request #406 from marcinolawski/master
I added 2 missing method to java.lang.Character.
This commit is contained in:
@ -174,6 +174,25 @@ public final class Character implements Comparable<Character> {
|
|||||||
return ch <= '\u001F' || (ch >= '\u007F' && ch <= '\u009F');
|
return ch <= '\u001F' || (ch >= '\u007F' && ch <= '\u009F');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static boolean isJavaIdentifierStart(char ch) {
|
||||||
|
return isLetter(ch) || ch == '$' || ch == '_';
|
||||||
|
//TODO: add if (getType(ch)==LETTER_NUMBER) || getType(ch)==CURRENCY_SYMBOL
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isJavaIdentifierStart(int c) {
|
||||||
|
return canCastToChar(c) && isJavaIdentifierStart((char) c);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isJavaIdentifierPart(char ch) {
|
||||||
|
return isJavaIdentifierStart(ch) || isDigit(ch);
|
||||||
|
//TODO:Check for numeric letters (such as a Roman numeral character),combining marks,non-spacing marks
|
||||||
|
//add isIdentifierIgnorable(ch)
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isJavaIdentifierPart(int c) {
|
||||||
|
return canCastToChar(c) && isJavaIdentifierPart((char) c);
|
||||||
|
}
|
||||||
|
|
||||||
public static int toCodePoint(char high, char low) {
|
public static int toCodePoint(char high, char low) {
|
||||||
return (((high & 0x3FF) << 10) | (low & 0x3FF)) + 0x10000;
|
return (((high & 0x3FF) << 10) | (low & 0x3FF)) + 0x10000;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user