net.rim.device.api.util
Class CharacterUtilities

java.lang.Object
  extended by net.rim.device.api.util.CharacterUtilities

public final class CharacterUtilities
extends Object

Retrieves Unicode attributes for characters.

Since:
BlackBerry API 3.6.0

Method Summary
static char getOriginal(char ch)
          Gets the first character in a decomposition, recursively.
static boolean isDigit(char aChar)
          Determines if the specified character is a digit.
static boolean isISOControl(char aChar)
          Determines if the specified character is a control character.
static boolean isLetter(char aChar)
          Determines if the specified character is a letter.
static boolean isLowerCase(char aChar)
          Determines if the specified character is a lowercase character.
static boolean isPunctuation(char aChar)
          Determines if the specified character is punctuation.
static boolean isSpaceChar(char aChar)
          Determines if the specified character is a separator.
static boolean isSymbol(char aChar)
          Determines if the specified character is a symbol.
static boolean isUpperCase(char aChar)
          Determines if the specified character is an uppercase character.
static boolean isWhitespace(char c)
          Determines if the supplied character should be considered white space.
static char toLowerCase(char aChar)
          Converts character to lower case (handles BMP characters only).
static char toUpperCase(char aChar)
          Converts character to upper case (handles BMP characters only).
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 



Method Detail

getOriginal

public static char getOriginal(char ch)
Gets the first character in a decomposition, recursively.

You can use this method for stripping accents off characters. For example, U+00E9 would return U+0065. U+1EDA would return U+004F.

Parameters:
ch - Character to use as source.
Returns:
First character from the supplied composed character.
See Also:
StringUtilities.convertToOriginal(StringBuffer, int, int)
Since:
BlackBerry API 3.6.0

isLowerCase

public static boolean isLowerCase(char aChar)
Determines if the specified character is a lowercase character.

Parameters:
aChar - the character to be tested.
Returns:
True if the character is lowercase.
Since:
BlackBerry API 4.0.0

isUpperCase

public static boolean isUpperCase(char aChar)
Determines if the specified character is an uppercase character.

Parameters:
aChar - the character to be tested.
Returns:
True if the character is uppercase.
Since:
BlackBerry API 4.0.0

isSymbol

public static boolean isSymbol(char aChar)
Determines if the specified character is a symbol.

Parameters:
aChar - the character to be tested.
Returns:
True if the character is a symbol.
Since:
BlackBerry API 4.0.0

isPunctuation

public static boolean isPunctuation(char aChar)
Determines if the specified character is punctuation.

Parameters:
aChar - the character to be tested.
Returns:
True if the character is punctuation.
Since:
BlackBerry API 4.0.0

isLetter

public static boolean isLetter(char aChar)
Determines if the specified character is a letter.

Parameters:
aChar - the character to be tested.
Returns:
True if the character is a letter.
Since:
BlackBerry API 4.0.0

isISOControl

public static boolean isISOControl(char aChar)
Determines if the specified character is a control character.

Parameters:
ch - the character to be tested.
Returns:
True if the character is a control character.
Since:
BlackBerry API 4.0.0

isSpaceChar

public static boolean isSpaceChar(char aChar)
Determines if the specified character is a separator.

Parameters:
aChar - the character to be tested.
Returns:
True if the character is a separator.
Since:
BlackBerry API 4.0.0

isWhitespace

public static final boolean isWhitespace(char c)
Determines if the supplied character should be considered white space.

This method considers as white space characters: newlines, carriage returns, tabs, non-breaking spaces, zero-width spaces, CJK spaces, spaces.

Sub-classes may override this method to provide a wider (or more restricted) class of white-space characters.

Parameters:
c - Character to test.
Returns:
True if provided character is considered whitespace; otherwise false.
Since:
BlackBerry API 7.0.0

isDigit

public static boolean isDigit(char aChar)
Determines if the specified character is a digit.

Parameters:
ch - the character to be tested.
Returns:
True if the character is a digit.
Since:
BlackBerry API 4.0.0

toLowerCase

public static char toLowerCase(char aChar)
Converts character to lower case (handles BMP characters only).

Parameters:
aChar - the character to be converted.
Returns:
lower case version of the character
Since:
BlackBerry API 4.0.0

toUpperCase

public static char toUpperCase(char aChar)
Converts character to upper case (handles BMP characters only).

Parameters:
aChar - the character to be converted.
Returns:
upper case version of the character
Since:
BlackBerry API 4.0.0





Copyright 1999-2011 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Java is a trademark of Oracle America Inc. in the US and other countries.
Legal