public final class Character extends Object implements Comparable<Character>, Serializable
char
as an object.
TODO(jat): many of the classification methods implemented here are not
correct in that they only handle ASCII characters, and many other methods
are not currently implemented. I think the proper approach is to introduce * a deferred binding parameter which substitutes an implementation using
a fully-correct Unicode character database, at the expense of additional
data being downloaded. That way developers that need the functionality
can get it without those who don't need it paying for it.
The following methods are still not implemented -- most would require Unicode character db to be useful: - digit / is* / to*(int codePoint) - isDefined(char) - isIdentifierIgnorable(char) - isJavaIdentifierPart(char) - isJavaIdentifierStart(char) - isJavaLetter(char) -- deprecated, so probably not - isJavaLetterOrDigit(char) -- deprecated, so probably not - isISOControl(char) - isMirrored(char) - isSpaceChar(char) - isTitleCase(char) - isUnicodeIdentifierPart(char) - isUnicodeIdentifierStart(char) - getDirectionality(*) - getNumericValue(*) - getType(*) - reverseBytes(char) -- any use for this at all in the browser? - toTitleCase(*) - all the category constants for classification The following do not properly handle characters outside of ASCII: - digit(char c, int radix) - isDigit(char c) - isLetter(char c) - isLetterOrDigit(char c) - isLowerCase(char c) - isUpperCase(char c)
Modifier and Type | Field and Description |
---|---|
static int |
BYTES |
static int |
MAX_CODE_POINT |
static char |
MAX_HIGH_SURROGATE |
static char |
MAX_LOW_SURROGATE |
static int |
MAX_RADIX |
static char |
MAX_SURROGATE |
static char |
MAX_VALUE |
static int |
MIN_CODE_POINT |
static char |
MIN_HIGH_SURROGATE |
static char |
MIN_LOW_SURROGATE |
static int |
MIN_RADIX |
static int |
MIN_SUPPLEMENTARY_CODE_POINT |
static char |
MIN_SURROGATE |
static char |
MIN_VALUE |
static int |
SIZE |
static Class<Character> |
TYPE |
Constructor and Description |
---|
Character(char value) |
Modifier and Type | Method and Description |
---|---|
static int |
charCount(int codePoint) |
char |
charValue() |
static int |
codePointAt(char[] a,
int index) |
static int |
codePointAt(char[] a,
int index,
int limit) |
static int |
codePointAt(CharSequence seq,
int index) |
static int |
codePointBefore(char[] a,
int index) |
static int |
codePointBefore(char[] a,
int index,
int start) |
static int |
codePointBefore(CharSequence cs,
int index) |
static int |
codePointCount(char[] a,
int offset,
int count) |
static int |
codePointCount(CharSequence seq,
int beginIndex,
int endIndex) |
static int |
compare(char x,
char y) |
int |
compareTo(Character c) |
static int |
digit(char c,
int radix) |
boolean |
equals(Object o) |
static char |
forDigit(int digit,
int radix) |
int |
hashCode() |
static int |
hashCode(char c) |
static boolean |
isBmpCodePoint(int codePoint) |
static boolean |
isDigit(char c) |
static boolean |
isHighSurrogate(char ch) |
static boolean |
isLetter(char c) |
static boolean |
isLetterOrDigit(char c) |
static boolean |
isLowerCase(char c) |
static boolean |
isLowSurrogate(char ch) |
static boolean |
isSpace(char c)
Deprecated.
|
static boolean |
isSupplementaryCodePoint(int codePoint) |
static boolean |
isSurrogatePair(char highSurrogate,
char lowSurrogate) |
static boolean |
isUpperCase(char c) |
static boolean |
isValidCodePoint(int codePoint) |
static boolean |
isWhitespace(char ch) |
static boolean |
isWhitespace(int codePoint) |
static int |
offsetByCodePoints(char[] a,
int start,
int count,
int index,
int codePointOffset) |
static int |
offsetByCodePoints(CharSequence seq,
int index,
int codePointOffset) |
static char[] |
toChars(int codePoint) |
static int |
toChars(int codePoint,
char[] dst,
int dstIndex) |
static int |
toCodePoint(char highSurrogate,
char lowSurrogate) |
static char |
toLowerCase(char c) |
String |
toString() |
static String |
toString(char x) |
static char |
toUpperCase(char c) |
static Character |
valueOf(char c) |
$isInstance
public static final int MIN_RADIX
public static final int MAX_RADIX
public static final char MIN_VALUE
public static final char MAX_VALUE
public static final char MIN_SURROGATE
public static final char MAX_SURROGATE
public static final char MIN_LOW_SURROGATE
public static final char MAX_LOW_SURROGATE
public static final char MIN_HIGH_SURROGATE
public static final char MAX_HIGH_SURROGATE
public static final int MIN_SUPPLEMENTARY_CODE_POINT
public static final int MIN_CODE_POINT
public static final int MAX_CODE_POINT
public static final int SIZE
public static final int BYTES
public static int charCount(int codePoint)
public static int codePointAt(char[] a, int index)
public static int codePointAt(char[] a, int index, int limit)
public static int codePointAt(CharSequence seq, int index)
public static int codePointBefore(char[] a, int index)
public static int codePointBefore(char[] a, int index, int start)
public static int codePointBefore(CharSequence cs, int index)
public static int codePointCount(char[] a, int offset, int count)
public static int codePointCount(CharSequence seq, int beginIndex, int endIndex)
public static int compare(char x, char y)
public static int digit(char c, int radix)
public static char forDigit(int digit, int radix)
public static int hashCode(char c)
public static boolean isBmpCodePoint(int codePoint)
public static boolean isDigit(char c)
public static boolean isHighSurrogate(char ch)
public static boolean isLetter(char c)
public static boolean isLetterOrDigit(char c)
public static boolean isLowerCase(char c)
public static boolean isLowSurrogate(char ch)
@Deprecated public static boolean isSpace(char c)
public static boolean isWhitespace(char ch)
public static boolean isWhitespace(int codePoint)
public static boolean isSupplementaryCodePoint(int codePoint)
public static boolean isSurrogatePair(char highSurrogate, char lowSurrogate)
public static boolean isUpperCase(char c)
public static boolean isValidCodePoint(int codePoint)
public static int offsetByCodePoints(char[] a, int start, int count, int index, int codePointOffset)
public static int offsetByCodePoints(CharSequence seq, int index, int codePointOffset)
public static char[] toChars(int codePoint)
public static int toChars(int codePoint, char[] dst, int dstIndex)
public static int toCodePoint(char highSurrogate, char lowSurrogate)
public static char toLowerCase(char c)
public static String toString(char x)
public static char toUpperCase(char c)
public static Character valueOf(char c)
public char charValue()
public int compareTo(Character c)
compareTo
in interface Comparable<Character>
Copyright © 2018. All rights reserved.