java.lang

Class Character

Implemented Interfaces:
Comparable<T>, Serializable

public final class Character
extends Object
implements Serializable, Comparable<T>

Wrapper class for the primitive char data type. In addition, this class allows one to retrieve property information and perform transformations on the defined characters in the Unicode Standard, Version 4.0.0. java.lang.Character is designed to be very dynamic, and as such, it retrieves information on the Unicode character set from a separate database, gnu.java.lang.CharData, which can be easily upgraded.

For predicates, boundaries are used to describe the set of characters for which the method will return true. This syntax uses fairly normal regular expression notation. See 5.13 of the Unicode Standard, Version 4.0, for the boundary specification.

See http://www.unicode.org for more information on the Unicode Standard.

Since:
1.0
See Also:
CharData, Serialized Form

Nested Class Summary

static class
Character.Subset
A subset of Unicode blocks.
static class
Character.UnicodeBlock
A family of character subsets in the Unicode specification.

Field Summary

static byte
COMBINING_SPACING_MARK
Mc = Mark, Spacing Combining (Normative).
static byte
CONNECTOR_PUNCTUATION
Pc = Punctuation, Connector (Informative).
static byte
CONTROL
Cc = Other, Control (Normative).
static byte
CURRENCY_SYMBOL
Sc = Symbol, Currency (Informative).
static byte
DASH_PUNCTUATION
Pd = Punctuation, Dash (Informative).
static byte
DECIMAL_DIGIT_NUMBER
Nd = Number, Decimal Digit (Normative).
static byte
DIRECTIONALITY_ARABIC_NUMBER
Weak bidirectional character type "AN".
static byte
DIRECTIONALITY_BOUNDARY_NEUTRAL
Weak bidirectional character type "BN".
static byte
DIRECTIONALITY_COMMON_NUMBER_SEPARATOR
Weak bidirectional character type "CS".
static byte
DIRECTIONALITY_EUROPEAN_NUMBER
Weak bidirectional character type "EN".
static byte
DIRECTIONALITY_EUROPEAN_NUMBER_SEPARATOR
Weak bidirectional character type "ES".
static byte
DIRECTIONALITY_EUROPEAN_NUMBER_TERMINATOR
Weak bidirectional character type "ET".
static byte
DIRECTIONALITY_LEFT_TO_RIGHT
Strong bidirectional character type "L".
static byte
DIRECTIONALITY_LEFT_TO_RIGHT_EMBEDDING
Strong bidirectional character type "LRE".
static byte
DIRECTIONALITY_LEFT_TO_RIGHT_OVERRIDE
Strong bidirectional character type "LRO".
static byte
DIRECTIONALITY_NONSPACING_MARK
Weak bidirectional character type "NSM".
static byte
DIRECTIONALITY_OTHER_NEUTRALS
Neutral bidirectional character type "ON".
static byte
DIRECTIONALITY_PARAGRAPH_SEPARATOR
Neutral bidirectional character type "B".
static byte
DIRECTIONALITY_POP_DIRECTIONAL_FORMAT
Weak bidirectional character type "PDF".
static byte
DIRECTIONALITY_RIGHT_TO_LEFT
Strong bidirectional character type "R".
static byte
DIRECTIONALITY_RIGHT_TO_LEFT_ARABIC
Strong bidirectional character type "AL".
static byte
DIRECTIONALITY_RIGHT_TO_LEFT_EMBEDDING
Strong bidirectional character type "RLE".
static byte
DIRECTIONALITY_RIGHT_TO_LEFT_OVERRIDE
Strong bidirectional character type "RLO".
static byte
DIRECTIONALITY_SEGMENT_SEPARATOR
Neutral bidirectional character type "S".
static byte
DIRECTIONALITY_UNDEFINED
Undefined bidirectional character type.
static byte
DIRECTIONALITY_WHITESPACE
Strong bidirectional character type "WS".
static byte
ENCLOSING_MARK
Me = Mark, Enclosing (Normative).
static byte
END_PUNCTUATION
Pe = Punctuation, Close (Informative).
static byte
FINAL_QUOTE_PUNCTUATION
Pf = Punctuation, Final Quote (Informative).
static byte
FORMAT
Cf = Other, Format (Normative).
static byte
INITIAL_QUOTE_PUNCTUATION
Pi = Punctuation, Initial Quote (Informative).
static byte
LETTER_NUMBER
Nl = Number, Letter (Normative).
static byte
LINE_SEPARATOR
Zl = Separator, Line (Normative).
static byte
LOWERCASE_LETTER
Ll = Letter, Lowercase (Informative).
static byte
MATH_SYMBOL
Sm = Symbol, Math (Informative).
static int
MAX_CODE_POINT
The maximum Unicode 4.0 code point, which is greater than the range of the char data type.
static char
MAX_HIGH_SURROGATE
The maximum Unicode high surrogate code unit, or leading-surrogate, in the UTF-16 character encoding.
static char
MAX_LOW_SURROGATE
The maximum Unicode low surrogate code unit, or trailing-surrogate, in the UTF-16 character encoding.
static int
MAX_RADIX
Largest value allowed for radix arguments in Java.
static char
MAX_SURROGATE
The maximum Unicode surrogate code unit in the UTF-16 character encoding.
static char
MAX_VALUE
The maximum value the char data type can hold.
static int
MIN_CODE_POINT
The minimum Unicode 4.0 code point.
static char
MIN_HIGH_SURROGATE
The minimum Unicode high surrogate code unit, or leading-surrogate, in the UTF-16 character encoding.
static char
MIN_LOW_SURROGATE
The minimum Unicode low surrogate code unit, or trailing-surrogate, in the UTF-16 character encoding.
static int
MIN_RADIX
Smallest value allowed for radix arguments in Java.
static int
MIN_SUPPLEMENTARY_CODE_POINT
The lowest possible supplementary Unicode code point (the first code point outside the basic multilingual plane (BMP)).
static char
MIN_SURROGATE
The minimum Unicode surrogate code unit in the UTF-16 character encoding.
static char
MIN_VALUE
The minimum value the char data type can hold.
static byte
MODIFIER_LETTER
Lm = Letter, Modifier (Informative).
static byte
MODIFIER_SYMBOL
Sk = Symbol, Modifier (Informative).
static byte
NON_SPACING_MARK
Mn = Mark, Non-Spacing (Normative).
static byte
OTHER_LETTER
Lo = Letter, Other (Informative).
static byte
OTHER_NUMBER
No = Number, Other (Normative).
static byte
OTHER_PUNCTUATION
Po = Punctuation, Other (Informative).
static byte
OTHER_SYMBOL
So = Symbol, Other (Informative).
static byte
PARAGRAPH_SEPARATOR
Zp = Separator, Paragraph (Normative).
static byte
PRIVATE_USE
Co = Other, Private Use (Normative).
static int
SIZE
The number of bits needed to represent a char.
static byte
SPACE_SEPARATOR
Zs = Separator, Space (Normative).
static byte
START_PUNCTUATION
Ps = Punctuation, Open (Informative).
static byte
SURROGATE
Cs = Other, Surrogate (Normative).
static byte
TITLECASE_LETTER
Lt = Letter, Titlecase (Informative).
static Class
TYPE
Class object representing the primitive char data type.
static byte
UNASSIGNED
Cn = Other, Not Assigned (Normative).
static byte
UPPERCASE_LETTER
Lu = Letter, Uppercase (Informative).

Constructor Summary

Character(char value)
Wraps up a character.

Method Summary

static int
charCount(int codePoint)
Return number of 16-bit characters required to represent the given code point.
char
charValue()
Returns the character which has been wrapped by this class.
static int
codePointAt(char[] chars, int index)
Get the code point at the specified index in the CharSequence.
static int
codePointAt(char[] chars, int index, int limit)
Get the code point at the specified index in the CharSequence.
static int
codePointAt(CharSequence sequence, int index)
Get the code point at the specified index in the CharSequence.
static int
codePointBefore(char[] chars, int index)
Get the code point before the specified index.
static int
codePointBefore(char[] chars, int index, int start)
Get the code point before the specified index.
static int
codePointBefore(CharSequence sequence, int index)
Get the code point before the specified index.
static int
codePointCount(char[] a, int offset, int count)
Returns the number of Unicode code points in the specified range of the given char array.
static int
codePointCount(CharSequence seq, int beginIndex, int endIndex)
Returns the number of Unicode code points in the specified range of the given CharSequence.
int
compareTo(Character anotherCharacter)
Compares another Character to this Character, numerically.
static int
digit(char ch, int radix)
Converts a character into a digit of the specified radix.
static int
digit(int codePoint, int radix)
Converts a character into a digit of the specified radix.
boolean
equals(Object o)
Determines if an object is equal to this object.
static char
forDigit(int digit, int radix)
Converts a digit into a character which represents that digit in a specified radix.
static byte
getDirectionality(char ch)
Returns the Unicode directionality property of the character.
static byte
getDirectionality(int codePoint)
Returns the Unicode directionality property of the character.
static int
getNumericValue(char ch)
Returns the Unicode numeric value property of a character.
static int
getNumericValue(int codePoint)
Returns the Unicode numeric value property of a character.
static int
getType(char ch)
Returns the Unicode general category property of a character.
static int
getType(int codePoint)
Returns the Unicode general category property of a character.
int
hashCode()
Returns the numerical value (unsigned) of the wrapped character.
static boolean
isDefined(char ch)
Determines if a character is part of the Unicode Standard.
static boolean
isDefined(int codePoint)
Determines if a character is part of the Unicode Standard.
static boolean
isDigit(char ch)
Determines if a character is a Unicode decimal digit.
static boolean
isDigit(int codePoint)
Determines if a character is a Unicode decimal digit.
static boolean
isHighSurrogate(char ch)
Return true if the given character is a high surrogate.
static boolean
isISOControl(char ch)
Determines if a character has the ISO Control property.
static boolean
isISOControl(int codePoint)
Determines if the character is an ISO Control character.
static boolean
isIdentifierIgnorable(char ch)
Determines if a character is ignorable in a Unicode identifier.
static boolean
isIdentifierIgnorable(int codePoint)
Determines if a character is ignorable in a Unicode identifier.
static boolean
isJavaIdentifierPart(char ch)
Determines if a character can follow the first letter in a Java identifier.
static boolean
isJavaIdentifierPart(int codePoint)
Determines if a character can follow the first letter in a Java identifier.
static boolean
isJavaIdentifierStart(char ch)
Determines if a character can start a Java identifier.
static boolean
isJavaIdentifierStart(int codePoint)
Determines if a character can start a Java identifier.
static boolean
isJavaLetter(char ch)
Deprecated. Replaced by isJavaIdentifierStart(char)
static boolean
isJavaLetterOrDigit(char ch)
Deprecated. Replaced by isJavaIdentifierPart(char)
static boolean
isLetter(char ch)
Determines if a character is a Unicode letter.
static boolean
isLetter(int codePoint)
Determines if a character is a Unicode letter.
static boolean
isLetterOrDigit(char ch)
Determines if a character is a Unicode letter or a Unicode digit.
static boolean
isLetterOrDigit(int codePoint)
Determines if a character is a Unicode letter or a Unicode digit.
static boolean
isLowSurrogate(char ch)
Return true if the given character is a low surrogate.
static boolean
isLowerCase(char ch)
Determines if a character is a Unicode lowercase letter.
static boolean
isLowerCase(int codePoint)
Determines if a character is a Unicode lowercase letter.
static boolean
isMirrored(char ch)
Determines whether the character is mirrored according to Unicode.
static boolean
isMirrored(int codePoint)
Determines whether the character is mirrored according to Unicode.
static boolean
isSpace(char ch)
Deprecated. Replaced by isWhitespace(char)
static boolean
isSpaceChar(char ch)
Determines if a character is a Unicode space character.
static boolean
isSpaceChar(int codePoint)
Determines if a character is a Unicode space character.
static boolean
isSupplementaryCodePoint(int codePoint)
Determines whether the specified code point is in the range 0x10000 ..
static boolean
isSurrogatePair(char ch1, char ch2)
Return true if the given characters compose a surrogate pair.
static boolean
isTitleCase(char ch)
Determines if a character is a Unicode titlecase letter.
static boolean
isTitleCase(int codePoint)
Determines if a character is a Unicode titlecase letter.
static boolean
isUnicodeIdentifierPart(char ch)
Determines if a character can follow the first letter in a Unicode identifier.
static boolean
isUnicodeIdentifierPart(int codePoint)
Determines if a character can follow the first letter in a Unicode identifier.
static boolean
isUnicodeIdentifierStart(char ch)
Determines if a character can start a Unicode identifier.
static boolean
isUnicodeIdentifierStart(int codePoint)
Determines if a character can start a Unicode identifier.
static boolean
isUpperCase(char ch)
Determines if a character is a Unicode uppercase letter.
static boolean
isUpperCase(int codePoint)
Determines if a character is a Unicode uppercase letter.
static boolean
isValidCodePoint(int codePoint)
Determines whether the specified code point is in the range 0x0000 ..
static boolean
isWhitespace(char ch)
Determines if a character is Java whitespace.
static boolean
isWhitespace(int codePoint)
Determines if a character is Java whitespace.
static int
offsetByCodePoints(char[] a, int start, int count, int index, int codePointOffset)
Returns the index into the given char subarray that is offset codePointOffset code points from index.
static int
offsetByCodePoints(CharSequence seq, int index, int codePointOffset)
Returns the index into the given CharSequence that is offset codePointOffset code points from index.
static char
reverseBytes(char val)
Reverse the bytes in val.
static char[]
toChars(int codePoint)
Converts a unicode code point to a UTF-16 representation of that code point.
static int
toChars(int codePoint, char[] dst, int dstIndex)
Converts a unicode code point to its UTF-16 representation.
static int
toCodePoint(char high, char low)
Given a valid surrogate pair, this returns the corresponding code point.
static char
toLowerCase(char ch)
Converts a Unicode character into its lowercase equivalent mapping.
static int
toLowerCase(int codePoint)
Converts a Unicode character into its lowercase equivalent mapping.
String
toString()
Converts the wrapped character into a String.
static String
toString(char ch)
Returns a String of length 1 representing the specified character.
static char
toTitleCase(char ch)
Converts a Unicode character into its titlecase equivalent mapping.
static int
toTitleCase(int codePoint)
Converts a Unicode character into its titlecase equivalent mapping.
static char
toUpperCase(char ch)
Converts a Unicode character into its uppercase equivalent mapping.
static int
toUpperCase(int codePoint)
Converts a Unicode character into its uppercase equivalent mapping.
static Character
valueOf(char val)
Returns an Character object wrapping the value.

Methods inherited from class java.lang.Object

clone, equals, extends Object> getClass, finalize, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Details

COMBINING_SPACING_MARK

public static final byte COMBINING_SPACING_MARK
Mc = Mark, Spacing Combining (Normative).
Field Value:
8
Since:
1.1

CONNECTOR_PUNCTUATION

public static final byte CONNECTOR_PUNCTUATION
Pc = Punctuation, Connector (Informative).
Field Value:
23
Since:
1.1

CONTROL

public static final byte CONTROL
Cc = Other, Control (Normative).
Field Value:
15
Since:
1.1

CURRENCY_SYMBOL

public static final byte CURRENCY_SYMBOL
Sc = Symbol, Currency (Informative).
Field Value:
26
Since:
1.1

DASH_PUNCTUATION

public static final byte DASH_PUNCTUATION
Pd = Punctuation, Dash (Informative).
Field Value:
20
Since:
1.1

DECIMAL_DIGIT_NUMBER

public static final byte DECIMAL_DIGIT_NUMBER
Nd = Number, Decimal Digit (Normative).
Field Value:
9
Since:
1.1

DIRECTIONALITY_ARABIC_NUMBER

public static final byte DIRECTIONALITY_ARABIC_NUMBER
Weak bidirectional character type "AN".
Field Value:
6
Since:
1.4

DIRECTIONALITY_BOUNDARY_NEUTRAL

public static final byte DIRECTIONALITY_BOUNDARY_NEUTRAL
Weak bidirectional character type "BN".
Field Value:
9
Since:
1.4

DIRECTIONALITY_COMMON_NUMBER_SEPARATOR

public static final byte DIRECTIONALITY_COMMON_NUMBER_SEPARATOR
Weak bidirectional character type "CS".
Field Value:
7
Since:
1.4

DIRECTIONALITY_EUROPEAN_NUMBER

public static final byte DIRECTIONALITY_EUROPEAN_NUMBER
Weak bidirectional character type "EN".
Field Value:
3
Since:
1.4

DIRECTIONALITY_EUROPEAN_NUMBER_SEPARATOR

public static final byte DIRECTIONALITY_EUROPEAN_NUMBER_SEPARATOR
Weak bidirectional character type "ES".
Field Value:
4
Since:
1.4

DIRECTIONALITY_EUROPEAN_NUMBER_TERMINATOR

public static final byte DIRECTIONALITY_EUROPEAN_NUMBER_TERMINATOR
Weak bidirectional character type "ET".
Field Value:
5
Since:
1.4

DIRECTIONALITY_LEFT_TO_RIGHT

public static final byte DIRECTIONALITY_LEFT_TO_RIGHT
Strong bidirectional character type "L".
Field Value:
0
Since:
1.4

DIRECTIONALITY_LEFT_TO_RIGHT_EMBEDDING

public static final byte DIRECTIONALITY_LEFT_TO_RIGHT_EMBEDDING
Strong bidirectional character type "LRE".
Field Value:
14
Since:
1.4

DIRECTIONALITY_LEFT_TO_RIGHT_OVERRIDE

public static final byte DIRECTIONALITY_LEFT_TO_RIGHT_OVERRIDE
Strong bidirectional character type "LRO".
Field Value:
15
Since:
1.4

DIRECTIONALITY_NONSPACING_MARK

public static final byte DIRECTIONALITY_NONSPACING_MARK
Weak bidirectional character type "NSM".
Field Value:
8
Since:
1.4

DIRECTIONALITY_OTHER_NEUTRALS

public static final byte DIRECTIONALITY_OTHER_NEUTRALS
Neutral bidirectional character type "ON".
Field Value:
13
Since:
1.4

DIRECTIONALITY_PARAGRAPH_SEPARATOR

public static final byte DIRECTIONALITY_PARAGRAPH_SEPARATOR
Neutral bidirectional character type "B".
Field Value:
10
Since:
1.4

DIRECTIONALITY_POP_DIRECTIONAL_FORMAT

public static final byte DIRECTIONALITY_POP_DIRECTIONAL_FORMAT
Weak bidirectional character type "PDF".
Field Value:
18
Since:
1.4

DIRECTIONALITY_RIGHT_TO_LEFT

public static final byte DIRECTIONALITY_RIGHT_TO_LEFT
Strong bidirectional character type "R".
Field Value:
1
Since:
1.4

DIRECTIONALITY_RIGHT_TO_LEFT_ARABIC

public static final byte DIRECTIONALITY_RIGHT_TO_LEFT_ARABIC
Strong bidirectional character type "AL".
Field Value:
2
Since:
1.4

DIRECTIONALITY_RIGHT_TO_LEFT_EMBEDDING

public static final byte DIRECTIONALITY_RIGHT_TO_LEFT_EMBEDDING
Strong bidirectional character type "RLE".
Field Value:
16
Since:
1.4

DIRECTIONALITY_RIGHT_TO_LEFT_OVERRIDE

public static final byte DIRECTIONALITY_RIGHT_TO_LEFT_OVERRIDE
Strong bidirectional character type "RLO".
Field Value:
17
Since:
1.4

DIRECTIONALITY_SEGMENT_SEPARATOR

public static final byte DIRECTIONALITY_SEGMENT_SEPARATOR
Neutral bidirectional character type "S".
Field Value:
11
Since:
1.4

DIRECTIONALITY_UNDEFINED

public static final byte DIRECTIONALITY_UNDEFINED
Undefined bidirectional character type. Undefined char values have undefined directionality in the Unicode specification.
Field Value:
-1
Since:
1.4

DIRECTIONALITY_WHITESPACE

public static final byte DIRECTIONALITY_WHITESPACE
Strong bidirectional character type "WS".
Field Value:
12
Since:
1.4

ENCLOSING_MARK

public static final byte ENCLOSING_MARK
Me = Mark, Enclosing (Normative).
Field Value:
7
Since:
1.1

END_PUNCTUATION

public static final byte END_PUNCTUATION
Pe = Punctuation, Close (Informative).
Field Value:
22
Since:
1.1

FINAL_QUOTE_PUNCTUATION

public static final byte FINAL_QUOTE_PUNCTUATION
Pf = Punctuation, Final Quote (Informative).
Field Value:
30
Since:
1.4

FORMAT

public static final byte FORMAT
Cf = Other, Format (Normative).
Field Value:
16
Since:
1.1

INITIAL_QUOTE_PUNCTUATION

public static final byte INITIAL_QUOTE_PUNCTUATION
Pi = Punctuation, Initial Quote (Informative).
Field Value:
29
Since:
1.4

LETTER_NUMBER

public static final byte LETTER_NUMBER
Nl = Number, Letter (Normative).
Field Value:
10
Since:
1.1

LINE_SEPARATOR

public static final byte LINE_SEPARATOR
Zl = Separator, Line (Normative).
Field Value:
13
Since:
1.1

LOWERCASE_LETTER

public static final byte LOWERCASE_LETTER
Ll = Letter, Lowercase (Informative).
Field Value:
2
Since:
1.1

MATH_SYMBOL

public static final byte MATH_SYMBOL
Sm = Symbol, Math (Informative).
Field Value:
25
Since:
1.1

MAX_CODE_POINT

public static final int MAX_CODE_POINT
The maximum Unicode 4.0 code point, which is greater than the range of the char data type. This value is 0x10FFFF.
Field Value:
1114111
Since:
1.5

MAX_HIGH_SURROGATE

public static final char MAX_HIGH_SURROGATE
The maximum Unicode high surrogate code unit, or leading-surrogate, in the UTF-16 character encoding. This value is '\uDBFF'.
Field Value:
'\udbff'
Since:
1.5

MAX_LOW_SURROGATE

public static final char MAX_LOW_SURROGATE
The maximum Unicode low surrogate code unit, or trailing-surrogate, in the UTF-16 character encoding. This value is '\uDFFF'.
Field Value:
'\udfff'
Since:
1.5

MAX_RADIX

public static final int MAX_RADIX
Largest value allowed for radix arguments in Java. This value is 36.
Field Value:
36

MAX_SURROGATE

public static final char MAX_SURROGATE
The maximum Unicode surrogate code unit in the UTF-16 character encoding. This value is '\uDFFF'.
Field Value:
'\udfff'
Since:
1.5

MAX_VALUE

public static final char MAX_VALUE
The maximum value the char data type can hold. This value is '\\uFFFF'.
Field Value:
'\uffff'

MIN_CODE_POINT

public static final int MIN_CODE_POINT
The minimum Unicode 4.0 code point. This value is 0.
Field Value:
0
Since:
1.5

MIN_HIGH_SURROGATE

public static final char MIN_HIGH_SURROGATE
The minimum Unicode high surrogate code unit, or leading-surrogate, in the UTF-16 character encoding. This value is '\uD800'.
Field Value:
'\ud800'
Since:
1.5

MIN_LOW_SURROGATE

public static final char MIN_LOW_SURROGATE
The minimum Unicode low surrogate code unit, or trailing-surrogate, in the UTF-16 character encoding. This value is '\uDC00'.
Field Value:
'\udc00'
Since:
1.5

MIN_RADIX

public static final int MIN_RADIX
Smallest value allowed for radix arguments in Java. This value is 2.
Field Value:
2

MIN_SUPPLEMENTARY_CODE_POINT

public static final int MIN_SUPPLEMENTARY_CODE_POINT
The lowest possible supplementary Unicode code point (the first code point outside the basic multilingual plane (BMP)). This value is 0x10000.
Field Value:
65536

MIN_SURROGATE

public static final char MIN_SURROGATE
The minimum Unicode surrogate code unit in the UTF-16 character encoding. This value is '\uD800'.
Field Value:
'\ud800'
Since:
1.5

MIN_VALUE

public static final char MIN_VALUE
The minimum value the char data type can hold. This value is '\\u0000'.
Field Value:
'\u0000'

MODIFIER_LETTER

public static final byte MODIFIER_LETTER
Lm = Letter, Modifier (Informative).
Field Value:
4
Since:
1.1

MODIFIER_SYMBOL

public static final byte MODIFIER_SYMBOL
Sk = Symbol, Modifier (Informative).
Field Value:
27
Since:
1.1

NON_SPACING_MARK

public static final byte NON_SPACING_MARK
Mn = Mark, Non-Spacing (Normative).
Field Value:
6
Since:
1.1

OTHER_LETTER

public static final byte OTHER_LETTER
Lo = Letter, Other (Informative).
Field Value:
5
Since:
1.1

OTHER_NUMBER

public static final byte OTHER_NUMBER
No = Number, Other (Normative).
Field Value:
11
Since:
1.1

OTHER_PUNCTUATION

public static final byte OTHER_PUNCTUATION
Po = Punctuation, Other (Informative).
Field Value:
24
Since:
1.1

OTHER_SYMBOL

public static final byte OTHER_SYMBOL
So = Symbol, Other (Informative).
Field Value:
28
Since:
1.1

PARAGRAPH_SEPARATOR

public static final byte PARAGRAPH_SEPARATOR
Zp = Separator, Paragraph (Normative).
Field Value:
14
Since:
1.1

PRIVATE_USE

public static final byte PRIVATE_USE
Co = Other, Private Use (Normative).
Field Value:
18
Since:
1.1

SIZE

public static final int SIZE
The number of bits needed to represent a char.
Field Value:
16
Since:
1.5

SPACE_SEPARATOR

public static final byte SPACE_SEPARATOR
Zs = Separator, Space (Normative).
Field Value:
12
Since:
1.1

START_PUNCTUATION

public static final byte START_PUNCTUATION
Ps = Punctuation, Open (Informative).
Field Value:
21
Since:
1.1

SURROGATE

public static final byte SURROGATE
Cs = Other, Surrogate (Normative).
Field Value:
19
Since:
1.1

TITLECASE_LETTER

public static final byte TITLECASE_LETTER
Lt = Letter, Titlecase (Informative).
Field Value:
3
Since:
1.1

TYPE

public static final Class TYPE
Class object representing the primitive char data type.
Since:
1.1

UNASSIGNED

public static final byte UNASSIGNED
Cn = Other, Not Assigned (Normative).
Field Value:
0
Since:
1.1

UPPERCASE_LETTER

public static final byte UPPERCASE_LETTER
Lu = Letter, Uppercase (Informative).
Field Value:
1
Since:
1.1

Constructor Details

Character

public Character(char value)
Wraps up a character.
Parameters:
value - the character to wrap

Method Details

charCount

public static int charCount(int codePoint)
Return number of 16-bit characters required to represent the given code point.
Parameters:
codePoint - a unicode code point
Returns:
2 if codePoint >= 0x10000, 1 otherwise.
Since:
1.5

charValue

public char charValue()
Returns the character which has been wrapped by this class.
Returns:
the character wrapped

codePointAt

public static int codePointAt(char[] chars,
                              int index)
Get the code point at the specified index in the CharSequence. If the character is the start of a surrogate pair, and there is a following character, and this character completes the pair, then the corresponding supplementary code point is returned. Otherwise, the character at the index is returned.
Parameters:
chars - the character array in which to look
index - the index of the codepoint to get, starting at 0
Returns:
the codepoint at the specified index
Throws:
IndexOutOfBoundsException - if index is negative or >= length()
Since:
1.5

codePointAt

public static int codePointAt(char[] chars,
                              int index,
                              int limit)
Get the code point at the specified index in the CharSequence. If the character is the start of a surrogate pair, and there is a following character within the specified range, and this character completes the pair, then the corresponding supplementary code point is returned. Otherwise, the character at the index is returned.
Parameters:
chars - the character array in which to look
index - the index of the codepoint to get, starting at 0
limit - the limit past which characters should not be examined
Returns:
the codepoint at the specified index
Throws:
IndexOutOfBoundsException - if index is negative or >= limit, or if limit is negative or >= the length of the array
Since:
1.5

codePointAt

public static int codePointAt(CharSequence sequence,
                              int index)
Get the code point at the specified index in the CharSequence. This is like CharSequence#charAt(int), but if the character is the start of a surrogate pair, and there is a following character, and this character completes the pair, then the corresponding supplementary code point is returned. Otherwise, the character at the index is returned.
Parameters:
sequence - the CharSequence
index - the index of the codepoint to get, starting at 0
Returns:
the codepoint at the specified index
Throws:
IndexOutOfBoundsException - if index is negative or >= length()
Since:
1.5

codePointBefore

public static int codePointBefore(char[] chars,
                                  int index)
Get the code point before the specified index. This is like #codePointAt(char[], int), but checks the characters at index-1 and index-2 to see if they form a supplementary code point. If they do not, the character at index-1 is returned.
Parameters:
chars - the character array
index - the index just past the codepoint to get, starting at 0
Returns:
the codepoint at the specified index
Throws:
IndexOutOfBoundsException - if index is negative or >= length()
Since:
1.5

codePointBefore

public static int codePointBefore(char[] chars,
                                  int index,
                                  int start)
Get the code point before the specified index. This is like #codePointAt(char[], int), but checks the characters at index-1 and index-2 to see if they form a supplementary code point. If they do not, the character at index-1 is returned. The start parameter is used to limit the range of the array which may be examined.
Parameters:
chars - the character array
index - the index just past the codepoint to get, starting at 0
start - the index before which characters should not be examined
Returns:
the codepoint at the specified index
Throws:
IndexOutOfBoundsException - if index is > start or > the length of the array, or if limit is negative or >= the length of the array
Since:
1.5

codePointBefore

public static int codePointBefore(CharSequence sequence,
                                  int index)
Get the code point before the specified index. This is like #codePointAt(CharSequence, int), but checks the characters at index-1 and index-2 to see if they form a supple