| java.lang.Object java.lang.Character
Character | final public class Character implements Serializable,Comparable<Character>(Code) | |
Character is the wrapper for the primitive type char . This
class also provides a number of utility methods for working with
char s.
Character data is based upon the Unicode Standard, 4.0. The Unicode
specification, character tables and other information are available at http://www.unicode.org/.
Unicode characters are referred to as code points. The range of valid
code points is U+0000 to U+10FFFF. The Basic Multilingual Plane (BMP)
is the code point range U+0000 to U+FFFF. Characters above the BMP are
referred to as Supplementary Characters. On the Java platform, UTF-16
encoding and char pairs are used to represent code points in
the supplementary range. A pair of char values that represent
a supplementary character are made up of a high surrogate with a
value range of 0xD800 to 0xDBFF and a low surrogate with a value
range of 0xDC00 to 0xDFFF.
On the Java platform a char value represents either a single
BMP code point or a UTF-16 unit that's part of a surrogate pair. The
int type is used to represent all Unicode code points.
since: 1.0 |
Inner Class :public static class Subset | |
Inner Class :final public static class UnicodeBlock extends Subset | |
Inner Class :static class valueOfCache | |
Constructor Summary | |
public | Character(char value) Constructs a new instance of the receiver which represents the char
valued argument. |
Method Summary | |
public static int | charCount(int codePoint)
Calculates the number of char values required to represent
the Unicode code point. | public char | charValue() Answers the char value which the receiver represents. | public static int | codePointAt(CharSequence seq, int index)
Returns the code point at the index in the CharSequence .
If char unit at the index is a high-surrogate unit, the
next index is less than the length of the sequence and the
char unit at the next index is a low surrogate unit, then
the code point represented by the pair is returned; otherwise the
char unit at the index is returned.
Parameters: seq - The sequence of char units. Parameters: index - The index into the seq to retrieve andconvert. | public static int | codePointAt(char[] seq, int index)
Returns the code point at the index in the char[] . | public static int | codePointAt(char[] seq, int index, int limit)
Returns the code point at the index in the char[] that's
within the limit. | public static int | codePointBefore(CharSequence seq, int index)
Returns the Unicode code point that proceeds the index in
the CharSequence . | public static int | codePointBefore(char[] seq, int index)
Returns the Unicode code point that proceeds the index in
the char[] . | public static int | codePointBefore(char[] seq, int index, int start)
Returns the Unicode code point that proceeds the index in
the char[] and isn't less than start . | public static int | codePointCount(CharSequence seq, int beginIndex, int endIndex)
Counts the number of Unicode code points in the subsequence of the
CharSequence , as delineated by the
beginIndex and endIndex . | public static int | codePointCount(char[] seq, int offset, int count)
Counts the number of Unicode code points in the subsequence of the
char[] , as delineated by the offset and
count . | public int | compareTo(Character c) Compares the receiver to the specified Character to determine the
relative ordering. | public static int | digit(char c, int radix) Convenient method to determine the value of character c in
the supplied radix. | public static int | digit(int codePoint, int radix) Convenient method to determine the value of character
codePoint in the supplied radix. | public boolean | equals(Object object) Compares the argument to the receiver, and answers true if they represent
the same object using a class specific comparison. | public static char | forDigit(int digit, int radix) Answers the character which represents the value in the specified radix. | public static byte | getDirectionality(char c) Gets the Unicode directionality of the specified character. | public static byte | getDirectionality(int codePoint) Gets the Unicode directionality of the specified character. | public static int | getNumericValue(char c) Gets the numeric value of the Unicode character. | public static int | getNumericValue(int codePoint) Gets the numeric value of the Unicode character. | public static int | getType(char c) Gets the general Unicode category of the specified character. | public static int | getType(int codePoint) Gets the general Unicode category of the specified character. | public int | hashCode() Answers an integer hash code for the receiver. | public static boolean | isDefined(char c) Answers whether the specified character is defined in the Unicode
specification. | public static boolean | isDefined(int codePoint) Answers whether the specified character is defined in the Unicode
specification. | public static boolean | isDigit(char c) Answers whether the character is a digit. | public static boolean | isDigit(int codePoint) Answers whether the character is a digit. | public static boolean | isHighSurrogate(char ch)
A test for determining if the char is a high
surrogate/leading surrogate unit that's used for representing
supplementary characters in UTF-16 encoding.
Parameters: ch - The char unit to test. | public static boolean | isISOControl(char c) Answers whether the character is an ISO control character. | public static boolean | isISOControl(int c) Answers whether the character is an ISO control character. | public static boolean | isIdentifierIgnorable(char c) Answers whether the specified character is ignorable in a Java or Unicode
identifier. | public static boolean | isIdentifierIgnorable(int codePoint) Answers whether the specified character is ignorable in a Java or Unicode
identifier. | public static boolean | isJavaIdentifierPart(char c) Answers whether the character is a valid part of a Unicode identifier as
other than the first character. | public static boolean | isJavaIdentifierPart(int codePoint) Answers whether the character is a valid part of a Unicode identifier as
other than the first character. | public static boolean | isJavaIdentifierStart(char c) | public static boolean | isJavaIdentifierStart(int codePoint) | public static boolean | isJavaLetter(char c) Answers whether the character is a Java letter. | public static boolean | isJavaLetterOrDigit(char c) Answers whether the character is a Java letter or digit character. | public static boolean | isLetter(char c) Answers whether the character is a letter. | public static boolean | isLetter(int codePoint) Answers whether the character is a letter. | public static boolean | isLetterOrDigit(char c) Answers whether the character is a letter or a digit. | public static boolean | isLetterOrDigit(int codePoint) Answers whether the character is a letter or a digit. | public static boolean | isLowSurrogate(char ch)
A test for determining if the char is a high
surrogate/leading surrogate unit that's used for representing
supplementary characters in UTF-16 encoding.
Parameters: ch - The char unit to test. | public static boolean | isLowerCase(char c) Answers whether the character is a lower case letter. | public static boolean | isLowerCase(int codePoint) Answers whether the character is a lower case letter. | public static boolean | isMirrored(char c) | public static boolean | isMirrored(int codePoint) | public static boolean | isSpace(char c) Answers whether the character is a Java space. | public static boolean | isSpaceChar(char c) Answers whether the character is a Unicode space character. | public static boolean | isSpaceChar(int codePoint) Answers whether the character is a Unicode space character. | public static boolean | isSupplementaryCodePoint(int codePoint)
A test for determining if the codePoint is within the
supplementary code point range.
Parameters: codePoint - The code point to test. | public static boolean | isSurrogatePair(char high, char low)
A test for determining if the char pair is a valid
surrogate pair.
Parameters: high - The high surrogate unit to test. Parameters: low - The low surrogate unit to test. | public static boolean | isTitleCase(char c) Answers whether the character is a titlecase character. | public static boolean | isTitleCase(int codePoint) Answers whether the character is a titlecase character. | public static boolean | isUnicodeIdentifierPart(char c) Answers whether the character is valid as part of a Unicode identifier as
other than the first character. | public static boolean | isUnicodeIdentifierPart(int codePoint) Answers whether the character is valid as part of a Unicode identifier as
other than the first character. | public static boolean | isUnicodeIdentifierStart(char c) Answers whether the character is a valid initial character for a Unicode
identifier. | public static boolean | isUnicodeIdentifierStart(int codePoint) Answers whether the character is a valid initial character for a Unicode
identifier. | public static boolean | isUpperCase(char c) Answers whether the character is an upper case letter. | public static boolean | isUpperCase(int codePoint) Answers whether the character is an upper case letter. | public static boolean | isValidCodePoint(int codePoint)
A test for determining if the codePoint is a valid Unicode
code point.
Parameters: codePoint - The code point to test. | public static boolean | isWhitespace(char c) Answers whether the character is a whitespace character in Java. | public static boolean | isWhitespace(int codePoint) Answers whether the character is a whitespace character in Java. | public static int | offsetByCodePoints(CharSequence seq, int index, int codePointOffset)
Determines the index into the CharSequence that is offset
(measured in code points and specified by codePointOffset ),
from the index argument.
Parameters: seq - The CharSequence to find the index within. Parameters: index - The index to begin from, within theCharSequence . Parameters: codePointOffset - The number of code points to look back orforwards; may be a negative or positive value. | public static int | offsetByCodePoints(char[] seq, int start, int count, int index, int codePointOffset)
Determines the index into the char[] that is offset
(measured in code points and specified by codePointOffset ),
from the index argument and is within the subsequence as
delineated by start and count .
Parameters: seq - The char[] to find the index within. Parameters: index - The index to begin from, within the char[] . Parameters: codePointOffset - The number of code points to look back orforwards; may be a negative or positive value. Parameters: start - The inclusive index that marks the beginning of thesubsequence. Parameters: count - The number of char values to include withinthe subsequence. | public static char | reverseBytes(char c) | public static int | toChars(int codePoint, char[] dst, int dstIndex)
Converts the Unicode code point, codePoint , into a UTF-16
encoded sequence and copies the value(s) into the
char[] dst , starting at the index
dstIndex .
Parameters: codePoint - The Unicode code point to encode. Parameters: dst - The char[] to copy the encoded value into. Parameters: dstIndex - The index to start copying into dst . | public static char[] | toChars(int codePoint)
Converts the Unicode code point, codePoint , into a UTF-16
encoded sequence that is returned as a char[] .
Parameters: codePoint - The Unicode code point to encode. | public static int | toCodePoint(char high, char low)
Converts a surrogate pair into a Unicode code point. | public static char | toLowerCase(char c) Answers the lower case equivalent for the character when the character is
an upper case letter, otherwise answers the character. | public static int | toLowerCase(int codePoint) Answers the lower case equivalent for the character when the character is
an upper case letter, otherwise answers the character. | public String | toString() Answers a string containing a concise, human-readable description of the
receiver. | public static String | toString(char value) Converts the specified character to its string representation. | public static char | toTitleCase(char c) Answers the title case equivalent for the character, otherwise answers the
character. | public static int | toTitleCase(int codePoint) Answers the title case equivalent for the character, otherwise answers the
character. | public static char | toUpperCase(char c) Answers the upper case equivalent for the character when the character is
a lower case letter, otherwise answers the character. | public static int | toUpperCase(int codePoint) Answers the upper case equivalent for the character when the character is
a lower case letter, otherwise answers the character. | public static Character | valueOf(char c)
Returns a Character instance for the char
value passed. |
COMBINING_SPACING_MARK | final public static byte COMBINING_SPACING_MARK(Code) | | Unicode category constant Mc.
|
CONNECTOR_PUNCTUATION | final public static byte CONNECTOR_PUNCTUATION(Code) | | Unicode category constant Pc.
|
CONTROL | final public static byte CONTROL(Code) | | Unicode category constant Cc.
|
CURRENCY_SYMBOL | final public static byte CURRENCY_SYMBOL(Code) | | Unicode category constant Sc.
|
DASH_PUNCTUATION | final public static byte DASH_PUNCTUATION(Code) | | Unicode category constant Pd.
|
DECIMAL_DIGIT_NUMBER | final public static byte DECIMAL_DIGIT_NUMBER(Code) | | Unicode category constant Nd.
|
DIRECTIONALITY_ARABIC_NUMBER | final public static byte DIRECTIONALITY_ARABIC_NUMBER(Code) | | Unicode bidirectional constant AN.
since: 1.4 |
DIRECTIONALITY_BOUNDARY_NEUTRAL | final public static byte DIRECTIONALITY_BOUNDARY_NEUTRAL(Code) | | Unicode bidirectional constant BN.
since: 1.4 |
DIRECTIONALITY_COMMON_NUMBER_SEPARATOR | final public static byte DIRECTIONALITY_COMMON_NUMBER_SEPARATOR(Code) | | Unicode bidirectional constant CS.
since: 1.4 |
DIRECTIONALITY_EUROPEAN_NUMBER | final public static byte DIRECTIONALITY_EUROPEAN_NUMBER(Code) | | Unicode bidirectional constant EN.
since: 1.4 |
DIRECTIONALITY_EUROPEAN_NUMBER_SEPARATOR | final public static byte DIRECTIONALITY_EUROPEAN_NUMBER_SEPARATOR(Code) | | Unicode bidirectional constant ES.
since: 1.4 |
DIRECTIONALITY_EUROPEAN_NUMBER_TERMINATOR | final public static byte DIRECTIONALITY_EUROPEAN_NUMBER_TERMINATOR(Code) | | Unicode bidirectional constant ET.
since: 1.4 |
DIRECTIONALITY_LEFT_TO_RIGHT | final public static byte DIRECTIONALITY_LEFT_TO_RIGHT(Code) | | Unicode bidirectional constant L.
since: 1.4 |
DIRECTIONALITY_LEFT_TO_RIGHT_EMBEDDING | final public static byte DIRECTIONALITY_LEFT_TO_RIGHT_EMBEDDING(Code) | | Unicode bidirectional constant LRE.
since: 1.4 |
DIRECTIONALITY_LEFT_TO_RIGHT_OVERRIDE | final public static byte DIRECTIONALITY_LEFT_TO_RIGHT_OVERRIDE(Code) | | Unicode bidirectional constant LRO.
since: 1.4 |
DIRECTIONALITY_NONSPACING_MARK | final public static byte DIRECTIONALITY_NONSPACING_MARK(Code) | | Unicode bidirectional constant NSM.
since: 1.4 |
DIRECTIONALITY_OTHER_NEUTRALS | final public static byte DIRECTIONALITY_OTHER_NEUTRALS(Code) | | Unicode bidirectional constant ON.
since: 1.4 |
DIRECTIONALITY_PARAGRAPH_SEPARATOR | final public static byte DIRECTIONALITY_PARAGRAPH_SEPARATOR(Code) | | Unicode bidirectional constant B.
since: 1.4 |
DIRECTIONALITY_POP_DIRECTIONAL_FORMAT | final public static byte DIRECTIONALITY_POP_DIRECTIONAL_FORMAT(Code) | | Unicode bidirectional constant PDF.
since: 1.4 |
DIRECTIONALITY_RIGHT_TO_LEFT | final public static byte DIRECTIONALITY_RIGHT_TO_LEFT(Code) | | Unicode bidirectional constant R.
since: 1.4 |
DIRECTIONALITY_RIGHT_TO_LEFT_ARABIC | final public static byte DIRECTIONALITY_RIGHT_TO_LEFT_ARABIC(Code) | | Unicode bidirectional constant AL.
since: 1.4 |
DIRECTIONALITY_RIGHT_TO_LEFT_EMBEDDING | final public static byte DIRECTIONALITY_RIGHT_TO_LEFT_EMBEDDING(Code) | | Unicode bidirectional constant RLE.
since: 1.4 |
DIRECTIONALITY_RIGHT_TO_LEFT_OVERRIDE | final public static byte DIRECTIONALITY_RIGHT_TO_LEFT_OVERRIDE(Code) | | Unicode bidirectional constant RLO.
since: 1.4 |
DIRECTIONALITY_SEGMENT_SEPARATOR | final public static byte DIRECTIONALITY_SEGMENT_SEPARATOR(Code) | | Unicode bidirectional constant S.
since: 1.4 |
DIRECTIONALITY_UNDEFINED | final public static byte DIRECTIONALITY_UNDEFINED(Code) | | Unicode bidirectional constant.
since: 1.4 |
DIRECTIONALITY_WHITESPACE | final public static byte DIRECTIONALITY_WHITESPACE(Code) | | Unicode bidirectional constant WS.
since: 1.4 |
ENCLOSING_MARK | final public static byte ENCLOSING_MARK(Code) | | Unicode category constant Me.
|
END_PUNCTUATION | final public static byte END_PUNCTUATION(Code) | | Unicode category constant Pe.
|
FINAL_QUOTE_PUNCTUATION | final public static byte FINAL_QUOTE_PUNCTUATION(Code) | | Unicode category constant Pf.
since: 1.4 |
FORMAT | final public static byte FORMAT(Code) | | Unicode category constant Cf.
|
INITIAL_QUOTE_PUNCTUATION | final public static byte INITIAL_QUOTE_PUNCTUATION(Code) | | Unicode category constant Pi.
since: 1.4 |
LETTER_NUMBER | final public static byte LETTER_NUMBER(Code) | | Unicode category constant Nl.
|
LINE_SEPARATOR | final public static byte LINE_SEPARATOR(Code) | | Unicode category constant Zl.
|
LOWERCASE_LETTER | final public static byte LOWERCASE_LETTER(Code) | | Unicode category constant Ll.
|
MATH_SYMBOL | final public static byte MATH_SYMBOL(Code) | | Unicode category constant Sm.
|
MAX_CODE_POINT | final public static int MAX_CODE_POINT(Code) | |
Maximum code point value - U+10FFFF .
since: 1.5 |
MAX_HIGH_SURROGATE | final public static char MAX_HIGH_SURROGATE(Code) | |
Maximum value of a high surrogate or leading surrogate unit in UTF-16
encoding - '\uDBFF' .
since: 1.5 |
MAX_LOW_SURROGATE | final public static char MAX_LOW_SURROGATE(Code) | | Maximum value of a low surrogate or trailing surrogate unit in UTF-16
encoding - '\uDFFF' .
since: 1.5 |
MAX_RADIX | final public static int MAX_RADIX(Code) | | The maximum possible radix used for conversions between Characters and
integers.
|
MAX_SURROGATE | final public static char MAX_SURROGATE(Code) | |
Maximum value of a surrogate unit in UTF-16 encoding - '\uDFFF' .
since: 1.5 |
MAX_VALUE | final public static char MAX_VALUE(Code) | | The maximum possible Character value.
|
MIN_CODE_POINT | final public static int MIN_CODE_POINT(Code) | |
Minimum code point value - U+0000 .
since: 1.5 |
MIN_HIGH_SURROGATE | final public static char MIN_HIGH_SURROGATE(Code) | |
Minimum value of a high surrogate or leading surrogate unit in UTF-16
encoding - '\uD800' .
since: 1.5 |
MIN_LOW_SURROGATE | final public static char MIN_LOW_SURROGATE(Code) | |
Minimum value of a low surrogate or trailing surrogate unit in UTF-16
encoding - '\uDC00' .
since: 1.5 |
MIN_RADIX | final public static int MIN_RADIX(Code) | | The minimum possible radix used for conversions between Characters and
integers.
|
MIN_SUPPLEMENTARY_CODE_POINT | final public static int MIN_SUPPLEMENTARY_CODE_POINT(Code) | |
Minimum value of a supplementary code point - U+010000 .
since: 1.5 |
MIN_SURROGATE | final public static char MIN_SURROGATE(Code) | |
Minimum value of a surrogate unit in UTF-16 encoding - '\uD800' .
since: 1.5 |
MIN_VALUE | final public static char MIN_VALUE(Code) | | The minimum possible Character value.
|
MODIFIER_LETTER | final public static byte MODIFIER_LETTER(Code) | | Unicode category constant Lm.
|
MODIFIER_SYMBOL | final public static byte MODIFIER_SYMBOL(Code) | | Unicode category constant Sk.
|
NON_SPACING_MARK | final public static byte NON_SPACING_MARK(Code) | | Unicode category constant Mn.
|
OTHER_LETTER | final public static byte OTHER_LETTER(Code) | | Unicode category constant Lo.
|
OTHER_NUMBER | final public static byte OTHER_NUMBER(Code) | | Unicode category constant No.
|
OTHER_PUNCTUATION | final public static byte OTHER_PUNCTUATION(Code) | | Unicode category constant Po.
|
OTHER_SYMBOL | final public static byte OTHER_SYMBOL(Code) | | Unicode category constant So.
|
PARAGRAPH_SEPARATOR | final public static byte PARAGRAPH_SEPARATOR(Code) | | Unicode category constant Zp.
|
PRIVATE_USE | final public static byte PRIVATE_USE(Code) | | Unicode category constant Co.
|
SIZE | final public static int SIZE(Code) | |
Constant for the number of bits to represent a char in
two's compliment form.
since: 1.5 |
SPACE_SEPARATOR | final public static byte SPACE_SEPARATOR(Code) | | Unicode category constant Zs.
|
START_PUNCTUATION | final public static byte START_PUNCTUATION(Code) | | Unicode category constant Ps.
|
SURROGATE | final public static byte SURROGATE(Code) | | Unicode category constant Cs.
|
TITLECASE_LETTER | final public static byte TITLECASE_LETTER(Code) | | Unicode category constant Lt.
|
UNASSIGNED | final public static byte UNASSIGNED(Code) | | Unicode category constant Cn.
|
UPPERCASE_LETTER | final public static byte UPPERCASE_LETTER(Code) | | Unicode category constant Lu.
|
Character | public Character(char value)(Code) | | Constructs a new instance of the receiver which represents the char
valued argument.
Parameters: value - the char to store in the new instance. |
charValue | public char charValue()(Code) | | Answers the char value which the receiver represents.
char the value of the receiver |
codePointAt | public static int codePointAt(CharSequence seq, int index)(Code) | |
Returns the code point at the index in the CharSequence .
If char unit at the index is a high-surrogate unit, the
next index is less than the length of the sequence and the
char unit at the next index is a low surrogate unit, then
the code point represented by the pair is returned; otherwise the
char unit at the index is returned.
Parameters: seq - The sequence of char units. Parameters: index - The index into the seq to retrieve andconvert. The Unicode code point. throws: NullPointerException - if seq is null . throws: IndexOutOfBoundsException - if the index is negativeor greater than or equal to seq.length() . since: 1.5 |
codePointAt | public static int codePointAt(char[] seq, int index)(Code) | |
Returns the code point at the index in the char[] . If
char unit at the index is a high-surrogate unit, the next
index is less than the length of the sequence and the char
unit at the next index is a low surrogate unit, then the code point
represented by the pair is returned; otherwise the char
unit at the index is returned.
Parameters: seq - The sequence of char units. Parameters: index - The index into the seq to retrieve andconvert. The Unicode code point. throws: NullPointerException - if seq is null . throws: IndexOutOfBoundsException - if the index is negativeor greater than or equal to seq.length() . since: 1.5 |
codePointAt | public static int codePointAt(char[] seq, int index, int limit)(Code) | |
Returns the code point at the index in the char[] that's
within the limit. If char unit at the index is a
high-surrogate unit, the next index is less than the limit
and the char unit at the next index is a low surrogate
unit, then the code point represented by the pair is returned; otherwise
the char unit at the index is returned.
Parameters: seq - The sequence of char units. Parameters: index - The index into the seq to retrieve andconvert. Parameters: limit - The exclusive index into the seq that marksthe end of the units that can be used. The Unicode code point. throws: NullPointerException - if seq is null . throws: IndexOutOfBoundsException - if the index isnegative, greater than or equal to limit ,limit is negative or limit isgreater than the length of seq . since: 1.5 |
codePointBefore | public static int codePointBefore(CharSequence seq, int index)(Code) | |
Returns the Unicode code point that proceeds the index in
the CharSequence . If the char unit at
index - 1 is within the low surrogate range, the value
index - 2 isn't negative and the char unit
at index - 2 is within the high surrogate range, then the
supplementary code point made up of the surrogate pair is returned;
otherwise, the char value at index - 1 is
returned.
Parameters: seq - The CharSequence to search. Parameters: index - The index into the seq . A Unicode code point. throws: NullPointerException - if seq is null . throws: IndexOutOfBoundsException - if index is less than 1or greater than seq.length() . since: 1.5 |
codePointBefore | public static int codePointBefore(char[] seq, int index)(Code) | |
Returns the Unicode code point that proceeds the index in
the char[] . If the char unit at
index - 1 is within the low surrogate range, the value
index - 2 isn't negative and the char unit
at index - 2 is within the high surrogate range, then the
supplementary code point made up of the surrogate pair is returned;
otherwise, the char value at index - 1 is
returned.
Parameters: seq - The char[] to search. Parameters: index - The index into the seq . A Unicode code point. throws: NullPointerException - if seq is null . throws: IndexOutOfBoundsException - if index is less than 1or greater than seq.length . since: 1.5 |
codePointBefore | public static int codePointBefore(char[] seq, int index, int start)(Code) | |
Returns the Unicode code point that proceeds the index in
the char[] and isn't less than start . If
the char unit at index - 1 is within the
low surrogate range, the value index - 2 isn't less than
start and the char unit at
index - 2 is within the high surrogate range, then the
supplementary code point made up of the surrogate pair is returned;
otherwise, the char value at index - 1 is
returned.
Parameters: seq - The char[] to search. Parameters: index - The index into the seq . A Unicode code point. throws: NullPointerException - if seq is null . throws: IndexOutOfBoundsException - if index is less than orequal to start , index is greaterthan seq.length , start is notnegative and start is greater thanseq.length . since: 1.5 |
codePointCount | public static int codePointCount(CharSequence seq, int beginIndex, int endIndex)(Code) | |
Counts the number of Unicode code points in the subsequence of the
CharSequence , as delineated by the
beginIndex and endIndex . Any surrogate
values with missing pair values will be counted as 1 code point.
Parameters: seq - The CharSequence to look through. Parameters: beginIndex - The inclusive index to begin counting at. Parameters: endIndex - The exclusive index to stop counting at. The number of Unicode code points. throws: NullPointerException - if seq is null . throws: IndexOutOfBoundsException - if beginIndex isnegative, greater than seq.length() or greaterthan endIndex . since: 1.5 |
codePointCount | public static int codePointCount(char[] seq, int offset, int count)(Code) | |
Counts the number of Unicode code points in the subsequence of the
char[] , as delineated by the offset and
count . Any surrogate values with missing pair values will
be counted as 1 code point.
Parameters: seq - The char[] to look through. Parameters: offset - The inclusive index to begin counting at. Parameters: count - The number of char values to look through inseq . The number of Unicode code points. throws: NullPointerException - if seq is null . throws: IndexOutOfBoundsException - if offset orcount is negative or if endIndex isgreater than seq.length . since: 1.5 |
compareTo | public int compareTo(Character c)(Code) | | Compares the receiver to the specified Character to determine the
relative ordering.
Parameters: c - the Character an int < 0 if this Character is less than the specifiedCharacter, 0 if they are equal, and > 0 if this Character isgreater throws: NullPointerException - if c is null . since: 1.2 |
digit | public static int digit(char c, int radix)(Code) | | Convenient method to determine the value of character c in
the supplied radix. The value of radix must be between
MIN_RADIX and MAX_RADIX.
Parameters: c - the character Parameters: radix - the radix if radix lies between Character.MIN_RADIX andCharacter.MAX_RADIX then the value of the character in the radix,otherwise -1. |
digit | public static int digit(int codePoint, int radix)(Code) | | Convenient method to determine the value of character
codePoint in the supplied radix. The value of
radix must be between MIN_RADIX and MAX_RADIX.
Parameters: codePoint - the character, including supplementary characters Parameters: radix - the radix if radix lies between Character.MIN_RADIX andCharacter.MAX_RADIX then the value of the character in the radix,otherwise -1. |
equals | public boolean equals(Object object)(Code) | | Compares the argument to the receiver, and answers true if they represent
the same object using a class specific comparison.
In this case, the argument must also be a Character, and the receiver and
argument must represent the same char value.
Parameters: object - the object to compare with this object true if the object is the same as this objectfalse if it is different from this object See Also: Character.hashCode |
forDigit | public static char forDigit(int digit, int radix)(Code) | | Answers the character which represents the value in the specified radix.
The radix must be between MIN_RADIX and MAX_RADIX inclusive.
Parameters: digit - the integer value Parameters: radix - the radix the character which represents the value in the radix |
getDirectionality | public static byte getDirectionality(char c)(Code) | | Gets the Unicode directionality of the specified character.
Parameters: c - the character the Unicode directionality |
getDirectionality | public static byte getDirectionality(int codePoint)(Code) | | Gets the Unicode directionality of the specified character.
Parameters: codePoint - the character, including supplementary characters the Unicode directionality |
getNumericValue | public static int getNumericValue(char c)(Code) | | Gets the numeric value of the Unicode character.
Parameters: c - the character a numeric int value >= 0, -1 if there is no numeric value, -2 ifthe numeric value is not an int >= 0 |
getNumericValue | public static int getNumericValue(int codePoint)(Code) | | Gets the numeric value of the Unicode character.
Parameters: codePoint - the character, including supplementary characters a numeric int value which is not negative, -1 if there is no numeric value, -2 ifthe numeric value is negative |
getType | public static int getType(char c)(Code) | | Gets the general Unicode category of the specified character.
Parameters: c - the character the Unicode category |
getType | public static int getType(int codePoint)(Code) | | Gets the general Unicode category of the specified character.
Parameters: codePoint - the character, including supplementary characters the Unicode category |
hashCode | public int hashCode()(Code) | | Answers an integer hash code for the receiver. Any two objects which
answer true when passed to equals must
answer the same value for this method.
the receiver's hash See Also: Character.equals |
isDefined | public static boolean isDefined(char c)(Code) | | Answers whether the specified character is defined in the Unicode
specification.
Parameters: c - the character true if the general Unicode category of the character is notUNASSIGNED, false otherwise |
isDefined | public static boolean isDefined(int codePoint)(Code) | | Answers whether the specified character is defined in the Unicode
specification.
Parameters: codePoint - the character, including supplementary characters true if the general Unicode category of the character is notUNASSIGNED, false otherwise |
isDigit | public static boolean isDigit(char c)(Code) | | Answers whether the character is a digit.
Parameters: c - the character true when the character is a digit, false otherwise |
isDigit | public static boolean isDigit(int codePoint)(Code) | | Answers whether the character is a digit.
Parameters: codePoint - the character, including supplementary characters true when the character is a digit, false otherwise |
isHighSurrogate | public static boolean isHighSurrogate(char ch)(Code) | |
A test for determining if the char is a high
surrogate/leading surrogate unit that's used for representing
supplementary characters in UTF-16 encoding.
Parameters: ch - The char unit to test. A boolean value. since: 1.5 See Also: Character.isLowSurrogate(char) |
isISOControl | public static boolean isISOControl(char c)(Code) | | Answers whether the character is an ISO control character.
Parameters: c - the character true if c is an ISO controlcharacter, otherwise false |
isISOControl | public static boolean isISOControl(int c)(Code) | | Answers whether the character is an ISO control character.
Parameters: c - the character, including supplementary characters true if c is an ISO controlcharacter, otherwise false |
isIdentifierIgnorable | public static boolean isIdentifierIgnorable(char c)(Code) | | Answers whether the specified character is ignorable in a Java or Unicode
identifier.
Parameters: c - the character true when the character is ignorable, false otherwise |
isIdentifierIgnorable | public static boolean isIdentifierIgnorable(int codePoint)(Code) | | Answers whether the specified character is ignorable in a Java or Unicode
identifier.
Parameters: codePoint - the character, including supplementary characters true when the character is ignorable, false otherwise |
isJavaIdentifierPart | public static boolean isJavaIdentifierPart(char c)(Code) | | Answers whether the character is a valid part of a Unicode identifier as
other than the first character.
Parameters: c - the character true when the character is valid as part of a Java identifier,false otherwise |
isJavaIdentifierPart | public static boolean isJavaIdentifierPart(int codePoint)(Code) | | Answers whether the character is a valid part of a Unicode identifier as
other than the first character.
Parameters: codePoint - the character, including supplementary characters true when the character is valid as part of a Java identifier,false otherwise |
isJavaIdentifierStart | public static boolean isJavaIdentifierStart(char c)(Code) | | Answers whether the character is a valid start of a Unicode identifier
Parameters: c - the character true when the character is a valid start of a Java identifier,false otherwise |
isJavaIdentifierStart | public static boolean isJavaIdentifierStart(int codePoint)(Code) | | Answers whether the character is a valid start of a Unicode identifier
Parameters: codePoint - the character, including supplementary characters true when the character is a valid start of a Java identifier,false otherwise |
isJavaLetter | public static boolean isJavaLetter(char c)(Code) | | Answers whether the character is a Java letter.
|
isJavaLetterOrDigit | public static boolean isJavaLetterOrDigit(char c)(Code) | | Answers whether the character is a Java letter or digit character.
|
isLetter | public static boolean isLetter(char c)(Code) | | Answers whether the character is a letter.
Parameters: c - the character true when the character is a letter, false otherwise |
isLetter | public static boolean isLetter(int codePoint)(Code) | | Answers whether the character is a letter.
Parameters: codePoint - the character, including supplementary characters true when the character is a letter, false otherwise |
isLetterOrDigit | public static boolean isLetterOrDigit(char c)(Code) | | Answers whether the character is a letter or a digit.
Parameters: c - the character true when the character is a letter or a digit, false otherwise |
isLetterOrDigit | public static boolean isLetterOrDigit(int codePoint)(Code) | | Answers whether the character is a letter or a digit.
Parameters: codePoint - the character, including supplementary characters true when the character is a letter or a digit, false otherwise |
isLowSurrogate | public static boolean isLowSurrogate(char ch)(Code) | |
A test for determining if the char is a high
surrogate/leading surrogate unit that's used for representing
supplementary characters in UTF-16 encoding.
Parameters: ch - The char unit to test. A boolean value. since: 1.5 See Also: Character.isHighSurrogate(char) |
isLowerCase | public static boolean isLowerCase(char c)(Code) | | Answers whether the character is a lower case letter.
Parameters: c - the character true when the character is a lower case letter, false otherwise |
isLowerCase | public static boolean isLowerCase(int codePoint)(Code) | | Answers whether the character is a lower case letter.
Parameters: codePoint - the character, including supplementary characters true when the character is a lower case letter, false otherwise |
isMirrored | public static boolean isMirrored(char c)(Code) | | Answers whether the specified character is mirrored
Parameters: c - the character true if the character is mirrored, false otherwise |
isMirrored | public static boolean isMirrored(int codePoint)(Code) | | Answers whether the specified character is mirrored
Parameters: codePoint - the character, including supplementary characters true if the character is mirrored, false otherwise |
isSpace | public static boolean isSpace(char c)(Code) | | Answers whether the character is a Java space.
|
isSpaceChar | public static boolean isSpaceChar(char c)(Code) | | Answers whether the character is a Unicode space character. A member of
one of the Unicode categories Space Separator, Line Separator, or
Paragraph Separator.
Parameters: c - the character true when the character is a Unicode space character, falseotherwise |
isSpaceChar | public static boolean isSpaceChar(int codePoint)(Code) | | Answers whether the character is a Unicode space character. A member of
one of the Unicode categories Space Separator, Line Separator, or
Paragraph Separator.
Parameters: codePoint - the character, including supplementary characters true when the character is a Unicode space character, falseotherwise |
isSupplementaryCodePoint | public static boolean isSupplementaryCodePoint(int codePoint)(Code) | |
A test for determining if the codePoint is within the
supplementary code point range.
Parameters: codePoint - The code point to test. A boolean value. since: 1.5 |
isSurrogatePair | public static boolean isSurrogatePair(char high, char low)(Code) | |
A test for determining if the char pair is a valid
surrogate pair.
Parameters: high - The high surrogate unit to test. Parameters: low - The low surrogate unit to test. A boolean value. since: 1.5 See Also: Character.isHighSurrogate(char) See Also: Character.isLowSurrogate(char) |
isTitleCase | public static boolean isTitleCase(char c)(Code) | | Answers whether the character is a titlecase character.
Parameters: c - the character true when the character is a titlecase character, falseotherwise |
isTitleCase | public static boolean isTitleCase(int codePoint)(Code) | | Answers whether the character is a titlecase character.
Parameters: codePoint - the character, including supplementary characters true when the character is a titlecase character, falseotherwise |
isUnicodeIdentifierPart | public static boolean isUnicodeIdentifierPart(char c)(Code) | | Answers whether the character is valid as part of a Unicode identifier as
other than the first character.
Parameters: c - the character true when the character is valid as part of a Unicode identifier,false otherwise |
isUnicodeIdentifierPart | public static boolean isUnicodeIdentifierPart(int codePoint)(Code) | | Answers whether the character is valid as part of a Unicode identifier as
other than the first character.
Parameters: codePoint - the character, including supplementary characters true when the character is valid as part of a Unicode identifier,false otherwise |
isUnicodeIdentifierStart | public static boolean isUnicodeIdentifierStart(char c)(Code) | | Answers whether the character is a valid initial character for a Unicode
identifier.
Parameters: c - the character true when the character is a valid start of a Unicode identifier,false otherwise |
isUnicodeIdentifierStart | public static boolean isUnicodeIdentifierStart(int codePoint)(Code) | | Answers whether the character is a valid initial character for a Unicode
identifier.
Parameters: codePoint - the character, including supplementary characters true when the character is a valid start of a Unicode identifier,false otherwise |
isUpperCase | public static boolean isUpperCase(char c)(Code) | | Answers whether the character is an upper case letter.
Parameters: c - the character true when the character is a upper case letter, false otherwise |
isUpperCase | public static boolean isUpperCase(int codePoint)(Code) | | Answers whether the character is an upper case letter.
Parameters: codePoint - the character, including supplementary characters true when the character is a upper case letter, false otherwise |
isValidCodePoint | public static boolean isValidCodePoint(int codePoint)(Code) | |
A test for determining if the codePoint is a valid Unicode
code point.
Parameters: codePoint - The code point to test. A boolean value. since: 1.5 |
isWhitespace | public static boolean isWhitespace(char c)(Code) | | Answers whether the character is a whitespace character in Java.
Parameters: c - the character true if the supplied c is a whitespace characterin Java, otherwise false. |
isWhitespace | public static boolean isWhitespace(int codePoint)(Code) | | Answers whether the character is a whitespace character in Java.
Parameters: codePoint - the character, including supplementary characters true if the supplied c is a whitespace characterin Java, otherwise false. |
offsetByCodePoints | public static int offsetByCodePoints(CharSequence seq, int index, int codePointOffset)(Code) | |
Determines the index into the CharSequence that is offset
(measured in code points and specified by codePointOffset ),
from the index argument.
Parameters: seq - The CharSequence to find the index within. Parameters: index - The index to begin from, within theCharSequence . Parameters: codePointOffset - The number of code points to look back orforwards; may be a negative or positive value. The calculated index that is codePointOffset codepoints from index . throws: NullPointerException - if seq is null . throws: IndexOutOfBoundsException - if index is negative,greater than seq.length() , there aren't enoughvalues in seq after index or beforeindex if codePointOffset isnegative. since: 1.5 |
offsetByCodePoints | public static int offsetByCodePoints(char[] seq, int start, int count, int index, int codePointOffset)(Code) | |
Determines the index into the char[] that is offset
(measured in code points and specified by codePointOffset ),
from the index argument and is within the subsequence as
delineated by start and count .
Parameters: seq - The char[] to find the index within. Parameters: index - The index to begin from, within the char[] . Parameters: codePointOffset - The number of code points to look back orforwards; may be a negative or positive value. Parameters: start - The inclusive index that marks the beginning of thesubsequence. Parameters: count - The number of char values to include withinthe subsequence. The calculated index that is codePointOffset codepoints from index . throws: NullPointerException - if seq is null . throws: IndexOutOfBoundsException - if start orcount is negative, start + count greater than seq.length , index isless than start , index is greaterthan start + count or there aren't enough valuesin seq after index or beforeindex if codePointOffset isnegative. since: 1.5 |
reverseBytes | public static char reverseBytes(char c)(Code) | | Reverse the order of the first and second bytes in character
Parameters: c - the character the character with reordered bytes. |
toChars | public static int toChars(int codePoint, char[] dst, int dstIndex)(Code) | |
Converts the Unicode code point, codePoint , into a UTF-16
encoded sequence and copies the value(s) into the
char[] dst , starting at the index
dstIndex .
Parameters: codePoint - The Unicode code point to encode. Parameters: dst - The char[] to copy the encoded value into. Parameters: dstIndex - The index to start copying into dst . The number of char value units copied intodst . throws: IllegalArgumentException - if codePoint is not avalid Unicode code point. throws: NullPointerException - if dst is null . throws: IndexOutOfBoundsException - if dstIndex is negative,greater than or equal to dst.length or equalsdst.length - 1 when codePoint is aCharacter.isSupplementaryCodePoint(int) supplementary code point. since: 1.5 |
toChars | public static char[] toChars(int codePoint)(Code) | |
Converts the Unicode code point, codePoint , into a UTF-16
encoded sequence that is returned as a char[] .
Parameters: codePoint - The Unicode code point to encode. The UTF-16 encoded char sequence; if code point isa Character.isSupplementaryCodePoint(int) supplementary code point,then a 2 char array is returned, otherwise a 1char array is returned. throws: IllegalArgumentException - if codePoint is not avalid Unicode code point. since: 1.5 |
toCodePoint | public static int toCodePoint(char high, char low)(Code) | |
Converts a surrogate pair into a Unicode code point. This method assume
that the pair are valid surrogates. If the pair are NOT valid surrogates,
then the result is indeterminate. The
Character.isSurrogatePair(char,char) method should be used prior to this
method to validate the pair.
Parameters: high - The high surrogate unit. Parameters: low - The low surrogate unit. The decoded code point. since: 1.5 See Also: Character.isSurrogatePair(char,char) |
toLowerCase | public static char toLowerCase(char c)(Code) | | Answers the lower case equivalent for the character when the character is
an upper case letter, otherwise answers the character.
Parameters: c - the character if c is not a lower case character then its lower casecounterpart, otherwise just c |
toLowerCase | public static int toLowerCase(int codePoint)(Code) | | Answers the lower case equivalent for the character when the character is
an upper case letter, otherwise answers the character.
Parameters: codePoint - the character, including supplementary characters if codePoint is not a lower case character then its lower casecounterpart, otherwise just codePoint |
toString | public String toString()(Code) | | Answers a string containing a concise, human-readable description of the
receiver.
a printable representation for the receiver. |
toString | public static String toString(char value)(Code) | | Converts the specified character to its string representation.
Parameters: value - the character the character converted to a string |
toTitleCase | public static char toTitleCase(char c)(Code) | | Answers the title case equivalent for the character, otherwise answers the
character.
Parameters: c - the character the title case equivalent of the character |
toTitleCase | public static int toTitleCase(int codePoint)(Code) | | Answers the title case equivalent for the character, otherwise answers the
character.
Parameters: codePoint - the character the title case equivalent of the character |
toUpperCase | public static char toUpperCase(char c)(Code) | | Answers the upper case equivalent for the character when the character is
a lower case letter, otherwise answers the character.
Parameters: c - the character if c is not an upper case character then its upper casecounterpart, otherwise just c |
toUpperCase | public static int toUpperCase(int codePoint)(Code) | | Answers the upper case equivalent for the character when the character is
a lower case letter, otherwise answers the character.
Parameters: codePoint - the character, including supplementary characters if codePoint is not an upper case character then its upper casecounterpart, otherwise just codePoint |
valueOf | public static Character valueOf(char c)(Code) | |
Returns a Character instance for the char
value passed. This method is preferred over the constructor, as this
method may maintain a cache of instances.
Parameters: c - The char value. A Character instance. since: 1.5 |
|
|