|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--moka.lang.Object | +--moka.lang.Character
The Character
class wraps a value of the primitive
type char
in an object. An object of type
Character
contains a single field whose type is
char
.
In addition, this class provides several methods for determining a character's category (lowercase letter, digit, etc.) and for converting characters from uppercase to lowercase and vice versa. Plus, this class offers several method for ANSI string manipulation.
Character information is based on the ASCII.
Constructor Summary | |
Character(char value)
Constructs a newly allocated Character object that
represents the primitive char argument. |
Method Summary | |
char |
charValue()
Returns the value of this Character object. |
static moka.lang.char_p |
concat(moka.lang.char_p ansiString,
moka.lang.char_p anotherAnsiString)
Concatenates another ANSI string to the end of the specified ANSI string. |
static moka.lang.char_p |
copyValueOf(moka.lang.char_p ansiString)
Returns a copy of the ANSI string argument. |
static moka.lang.char_p |
copyValueOf(moka.lang.char_p data,
int offset,
int count)
Returns the ANSI string representation of a specific subarray of the char array argument. |
boolean |
equals(moka.lang.Object obj)
Compares this object against the specified object. |
static boolean |
isDigit(char ch)
Determines if the specified character is a digit. |
static boolean |
isLetter(char ch)
Determines if the specified character is a letter. |
static boolean |
isLowerCase(char ch)
Determines if the specified character is a lowercase character. |
static boolean |
isUpperCase(char ch)
Determines if the specified character is an uppercase character. |
static moka.lang.char_p |
substring(moka.lang.char_p ansiString,
int beginIndex,
int endIndex)
Returns a new ANSI string that is a substring of the specified ANSI string. |
static char |
toLowerCase(char ch)
Converts the character argument to lowercase using case mapping information from the TI-92 Plus Character Codes chart. |
moka.lang.String |
toString()
Returns a String object representing this
Character 's value. |
static char |
toUpperCase(char ch)
Converts the character argument to uppercase using case mapping information from the TI-92 Plus Character Codes chart. |
static moka.lang.char_p |
toVat(moka.lang.char_p string)
Converts an ANSI string into a TIOS VAT String. |
static moka.lang.char_p |
toVat(moka.lang.String string)
Converts a String object into a TIOS VAT String then finalizes the String. |
Methods inherited from class moka.lang.Object |
finalize, getClassName |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public Character(char value)
Character
object that
represents the primitive char
argument.
value
- the value to be represented by the char
.Method Detail |
public boolean equals(moka.lang.Object obj)
true
if and only if the argument is not
null
and is a Character
object that
represents the same char
value as this object.
equals
in class Object
obj
- the object to compare with.
true
if the objects are the same;
false
otherwise.public moka.lang.String toString()
String
object representing this
Character
's value. The result is a string of
length 1 whose sole component is the primitive
char
value represented by this
Character
object.
toString
in class Object
public char charValue()
Character
object.
char
value represented by
this object.public static moka.lang.char_p concat(moka.lang.char_p ansiString, moka.lang.char_p anotherAnsiString)
If the length of the argument string is 0
, then this
ANSI String object is copied then returned. Otherwise, a new
ANSI String object is created, representing a character
sequence that is the concatenation of the character sequence
represented by this ANSI String object and the character
sequence represented by the argument string.
ansiString
- the ANSI String that will be followed by the other ANSI string.anotherAnsiString
- the ANSI String that is concatenated to the end
of the specified ANSI String.
public static moka.lang.char_p copyValueOf(moka.lang.char_p ansiString)
public static moka.lang.char_p copyValueOf(moka.lang.char_p data, int offset, int count)
char
array argument.
The offset
argument is the index of the first
character of the subarray. The count
argument
specifies the length of the subarray. The contents of the subarray
are copied; subsequent modification of the character array does not
affect the newly created string.
data
- the character array.offset
- the initial offset into the value of the
ANSI string.count
- the length of the value of the String
.
public static moka.lang.char_p toVat(moka.lang.char_p string)
string
- The ANSI string
public static moka.lang.char_p toVat(moka.lang.String string)
string
- The String object
public static boolean isDigit(char ch)
ch
- the character to be tested.
true
if the character is a digit;
false
otherwise.public static boolean isLetter(char ch)
ch
- the character to be tested.
true
if the character is a letter;
false
otherwise.public static boolean isLowerCase(char ch)
The following are examples of lowercase characters:
a b c d e f g h i j k l m n o p q r s t u v w x y z
ch
- the character to be tested.
true
if the character is lowercase;
false
otherwise.public static boolean isUpperCase(char ch)
The following are examples of uppercase characters:
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
ch
- the character to be tested.
true
if the character is uppercase;
false
otherwise.public static moka.lang.char_p substring(moka.lang.char_p ansiString, int beginIndex, int endIndex)
beginIndex
and
extends to the character at index endIndex - 1
.
Thus the length of the substring is endIndex-beginIndex
.
ansiString
- the specified ANSI string.beginIndex
- the beginning index, inclusive.endIndex
- the ending index, exclusive.
public static char toLowerCase(char ch)
ch
- the character to be converted.
public static char toUpperCase(char ch)
ch
- the character to be converted.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |