FileDocCategorySizeDatePackage
DefaultCaseConverter.javaAPI DocphoneME MR2 API (J2ME)5096Wed May 02 17:59:54 BST 2007com.sun.cldc.i18n.uclc

DefaultCaseConverter

public class DefaultCaseConverter extends Object
Default class converting the case of characters.
version
1.0 04/04/2000

Fields Summary
Constructors Summary
Methods Summary
public static intdigit(char ch, int radix)
Returns the numeric value of the character ch in the specified radix. This is only supported for ISO-LATIN-1 characters.

param
ch the character to be converted.
param
radix the radix.
return
the numeric value represented by the character in the specified radix.
see
java.lang.Character#isDigit(char)
since
JDK1.0

        int value = -1;
        if (radix >= Character.MIN_RADIX && radix <= Character.MAX_RADIX) {
          if (isDigit(ch)) {
              value = ch - '0";
          }
          else if (isUpperCase(ch) || isLowerCase(ch)) {
              // Java supradecimal digit
              value = (ch & 0x1F) + 9;
          }
        }
        return (value < radix) ? value : -1;
    
public static booleanisDigit(char ch)
Determines if the specified character is a digit. This is currently only supported for ISO-LATIN-1 digits: "0" through "9".

param
ch the character to be tested.
return
true if the character is a digit; false otherwise.
since
JDK1.0

        return ch >= '0" && ch <= '9";
    
public static booleanisLowerCase(char ch)
Determines if the specified character is a lowercase character. This is currently only supported for ISO-LATIN-1 characters: "a" through "z".

param
ch the character to be tested.
return
true if the character is lowercase; false otherwise.
since
JDK1.0

        return ch >= 'a" && ch <= 'z";
    
public static booleanisUpperCase(char ch)
Determines if the specified character is an uppercase character. This is currently only supported for ISO-LATIN-1 characters: "A" through "Z".

param
ch the character to be tested.
return
true if the character is uppercase; false otherwise.
see
java.lang.Character#isLowerCase(char)
see
java.lang.Character#toUpperCase(char)
since
1.0

        return ch >= 'A" && ch <= 'Z";
    
public static chartoLowerCase(char ch)
The given character is mapped to its lowercase equivalent; if the character has no lowercase equivalent, the character itself is returned. This is currently only supported for ISO-LATIN-1 characters.

param
ch the character to be converted.
return
the lowercase equivalent of the character, if any; otherwise the character itself.
see
java.lang.Character#isLowerCase(char)
see
java.lang.Character#isUpperCase(char)
see
java.lang.Character#toUpperCase(char)
since
JDK1.0

        if (isUpperCase(ch))
          return (char)(ch + ('a" - 'A"));
        else
          return ch;
    
public static chartoUpperCase(char ch)
Converts the character argument to uppercase; if the character has no lowercase equivalent, the character itself is returned. This is currently only supported for ISO-LATIN-1 characters.

param
ch the character to be converted.
return
the uppercase equivalent of the character, if any; otherwise the character itself.
see
java.lang.Character#isLowerCase(char)
see
java.lang.Character#isUpperCase(char)
see
java.lang.Character#toLowerCase(char)
since
JDK1.0

        if (isLowerCase(ch))
          return (char)(ch - ('a" - 'A"));
        else
          return ch;