#include <src/main/decaf/lang/Character.h>
Static Public Member Functions |
static Character | valueOf (char value) |
| Returns a Character instance representing the specified char value.
|
static bool | isWhitespace (char c) |
| Indicates whether or not the given character is considered whitespace.
|
static bool | isDigit (char c) |
| Indicates whether or not the given character is a digit.
|
static bool | isLowerCase (char c) |
| Indicates whether or not the given character is a lower case character.
|
static bool | isUpperCase (char c) |
| Indicates whether or not the given character is a upper case character.
|
static bool | isLetter (char c) |
| Indicates whether or not the given character is a letter.
|
static bool | isLetterOrDigit (char c) |
| Indicates whether or not the given character is either a letter or a digit.
|
static bool | isISOControl (char c) |
| Answers whether the character is an ISO control character, which is a char that lays in the range of 0 to 1f and 7f to 9f.
|
static int | digit (char c, int radix) |
| Returns the numeric value of the character ch in the specified radix.
|
static char | toLowerCase (char value) |
| Returns the lower case equivalent for the specified character if the character is an upper case letter.
|
static char | toUpperCase (char value) |
| Returns the upper case equivalent for the specified character if the character is a lower case letter.
|
Static Public Attributes |
static const int | MIN_RADIX = 2 |
| The minimum radix available for conversion to and from strings.
|
static const int | MAX_RADIX = 36 |
| The maximum radix available for conversion to and from strings.
|
static const char | MIN_VALUE = (char)0x7F |
| The minimum value that a signed char can take on.
|
static const char | MAX_VALUE = (char)0x80 |
| The maximum value that a signed char can take on.
|
static const int | SIZE = 8 |
| The size of the primitive charactor in bits.
|
Constructor & Destructor Documentation
decaf::lang::Character::Character |
( |
char |
value | ) |
|
Member Function Documentation
virtual unsigned char decaf::lang::Character::byteValue |
( |
| ) |
const |
|
inlinevirtual |
Answers the byte value which the receiver represents.
- Returns
- int the value of the receiver.
Reimplemented from decaf::lang::Number.
virtual int decaf::lang::Character::compareTo |
( |
const Character & |
c | ) |
const |
|
inlinevirtual |
Compares this Character instance with another.
- Parameters
-
- Returns
- zero if this object represents the same char value as the argument; a positive value if this object represents a value greater than the passed in value, and -1 if this object repesents a value less than the passed in value.
Implements decaf::lang::Comparable< Character >.
virtual int decaf::lang::Character::compareTo |
( |
const char & |
c | ) |
const |
|
inlinevirtual |
Compares this Character instance with a char type.
- Parameters
-
c | - the char instance to be compared |
- Returns
- zero if this object represents the same char value as the argument; a positive value if this object represents a value greater than the passed in value, and -1 if this object repesents a value less than the passed in value.
Implements decaf::lang::Comparable< char >.
static int decaf::lang::Character::digit |
( |
char |
c, |
|
|
int |
radix |
|
) |
| |
|
static |
Returns the numeric value of the character ch in the specified radix.
If the radix is not in the range MIN_RADIX <= radix <= MAX_RADIX or if the value of ch is not a valid digit in the specified radix, -1 is returned. A character is a valid digit if at least one of the following is true:
- The method isDigit is true of the character and the single-character decomposition is less than the specified radix. In this case the decimal digit value is returned.
- The character is one of the uppercase Latin letters 'A' through 'Z' and its code is less than radix + 'A' - 10. In this case, ch - 'A' + 10 is returned.
- The character is one of the lowercase Latin letters 'a' through 'z' and its code is less than radix + 'a' - 10. In this case, ch - 'a' + 10 is returned.
- Parameters
-
c | - the char to be converted |
radix | - the radix of the number |
- Returns
- the numeric value of the number represented in the given radix
virtual double decaf::lang::Character::doubleValue |
( |
| ) |
const |
|
inlinevirtual |
Answers the double value which the receiver represents.
- Returns
- double the value of the receiver.
Implements decaf::lang::Number.
bool decaf::lang::Character::equals |
( |
const char & |
c | ) |
const |
|
inlinevirtual |
virtual float decaf::lang::Character::floatValue |
( |
| ) |
const |
|
inlinevirtual |
Answers the float value which the receiver represents.
- Returns
- float the value of the receiver.
Implements decaf::lang::Number.
virtual int decaf::lang::Character::intValue |
( |
| ) |
const |
|
inlinevirtual |
Answers the int value which the receiver represents.
- Returns
- int the value of the receiver.
Implements decaf::lang::Number.
static bool decaf::lang::Character::isDigit |
( |
char |
c | ) |
|
|
inlinestatic |
Indicates whether or not the given character is a digit.
static bool decaf::lang::Character::isISOControl |
( |
char |
c | ) |
|
|
inlinestatic |
Answers whether the character is an ISO control character, which is a char that lays in the range of 0 to 1f and 7f to 9f.
- Parameters
-
c | - the character, including supplementary characters |
- Returns
- true if the char is an ISO control character
static bool decaf::lang::Character::isLetter |
( |
char |
c | ) |
|
|
inlinestatic |
Indicates whether or not the given character is a letter.
static bool decaf::lang::Character::isLetterOrDigit |
( |
char |
c | ) |
|
|
inlinestatic |
Indicates whether or not the given character is either a letter or a digit.
static bool decaf::lang::Character::isLowerCase |
( |
char |
c | ) |
|
|
inlinestatic |
Indicates whether or not the given character is a lower case character.
static bool decaf::lang::Character::isUpperCase |
( |
char |
c | ) |
|
|
inlinestatic |
Indicates whether or not the given character is a upper case character.
static bool decaf::lang::Character::isWhitespace |
( |
char |
c | ) |
|
|
inlinestatic |
Indicates whether or not the given character is considered whitespace.
virtual long long decaf::lang::Character::longValue |
( |
| ) |
const |
|
inlinevirtual |
Answers the long value which the receiver represents.
- Returns
- long the value of the receiver.
Implements decaf::lang::Number.
virtual bool decaf::lang::Character::operator< |
( |
const Character & |
c | ) |
const |
|
inlinevirtual |
Compares this object to another and returns true if this object is considered to be less than the one passed.
This
- Parameters
-
c | - the value to be compared to this one. |
- Returns
- true if this object is equal to the one passed.
Implements decaf::lang::Comparable< Character >.
virtual bool decaf::lang::Character::operator< |
( |
const char & |
c | ) |
const |
|
inlinevirtual |
Compares this object to another and returns true if this object is considered to be less than the one passed.
This
- Parameters
-
c | - the value to be compared to this one. |
- Returns
- true if this object is equal to the one passed.
Implements decaf::lang::Comparable< char >.
virtual bool decaf::lang::Character::operator== |
( |
const Character & |
c | ) |
const |
|
inlinevirtual |
Compares equality between this object and the one passed.
- Parameters
-
c | - the value to be compared to this one. |
- Returns
- true if this object is equal to the one passed.
Implements decaf::lang::Comparable< Character >.
virtual bool decaf::lang::Character::operator== |
( |
const char & |
c | ) |
const |
|
inlinevirtual |
Compares equality between this object and the one passed.
- Parameters
-
c | - the value to be compared to this one. |
- Returns
- true if this object is equal to the one passed.
Implements decaf::lang::Comparable< char >.
virtual short decaf::lang::Character::shortValue |
( |
| ) |
const |
|
inlinevirtual |
Answers the short value which the receiver represents.
- Returns
- int the value of the receiver.
Reimplemented from decaf::lang::Number.
static char decaf::lang::Character::toLowerCase |
( |
char |
value | ) |
|
|
inlinestatic |
Returns the lower case equivalent for the specified character if the character is an upper case letter.
Otherwise, the specified character is returned unchanged.
- Parameters
-
value | the character to convert if needed. |
- Returns
- if value is an upper case character then its lower case counterpart, otherwise just returns value unchanged.
std::string decaf::lang::Character::toString |
( |
| ) |
const |
static char decaf::lang::Character::toUpperCase |
( |
char |
value | ) |
|
|
inlinestatic |
Returns the upper case equivalent for the specified character if the character is a lower case letter.
Otherwise, the specified character is returned unchanged.
- Parameters
-
value | the character to convert to upper case if needed. |
- Returns
- if value is a lower case character then its upper case counterpart, otherwise just returns value unchanged.
static Character decaf::lang::Character::valueOf |
( |
char |
value | ) |
|
|
inlinestatic |
Returns a Character instance representing the specified char value.
- Parameters
-
value | - the primitive char to wrap. |
- Returns
- a new Charactor instance that wraps this value.
Field Documentation
const int decaf::lang::Character::MAX_RADIX = 36 |
|
static |
The maximum radix available for conversion to and from strings.
const char decaf::lang::Character::MAX_VALUE = (char)0x80 |
|
static |
The maximum value that a signed char can take on.
const int decaf::lang::Character::MIN_RADIX = 2 |
|
static |
The minimum radix available for conversion to and from strings.
const char decaf::lang::Character::MIN_VALUE = (char)0x7F |
|
static |
The minimum value that a signed char can take on.
const int decaf::lang::Character::SIZE = 8 |
|
static |
The size of the primitive charactor in bits.
The documentation for this class was generated from the following file: