18 #ifndef _DECAF_LANG_CHARACTER_H_ 19 #define _DECAF_LANG_CHARACTER_H_ 40 static const int MIN_RADIX = 2;
43 static const int MAX_RADIX = 36;
46 static const char MIN_VALUE = (char)0x7F;
49 static const char MAX_VALUE = (char)0x80;
52 static const int SIZE = 8;
70 return this->value < c.value ? -1 : (this->value > c.value) ? 1 : 0;
79 return this->value == c.value;
89 return this->value < c.value;
101 return this->value < c ? -1 : (this->value > c) ? 1 : 0;
110 return this->value == c;
120 return this->value < c;
127 return this->value == c.value;
134 return this->value == c;
140 std::string toString()
const;
147 return (
double)this->value;
155 return (
float)this->value;
163 return (
unsigned char)this->value;
171 return (
short)this->value;
179 return (
int)this->value;
187 return (
long long)this->value;
224 return c >=
'0' && c <=
'9';
232 return c >=
'a' && c <=
'z';
240 return c >=
'A' && c <=
'Z';
248 return isUpperCase(c) || isLowerCase(c);
256 return isLetter(c) || isDigit(c);
266 return ( c >= 0 && c <= 0x1f ) ||
267 ( (
unsigned char)c >= 0x7f && (
unsigned char)c <= 0x9f );
292 static int digit(
char c,
int radix);
305 if (
'A' <= value && value <=
'Z') {
306 return (
char) (value + (
'a' -
'A'));
323 if (
'a' <= value && value <=
'z') {
324 return (
char) (value - (
'a' -
'A'));
static bool isDigit(char c)
Indicates whether or not the given character is a digit.
Definition: Character.h:223
virtual short shortValue() const
Answers the short value which the receiver represents.
Definition: Character.h:170
static bool isLetter(char c)
Indicates whether or not the given character is a letter.
Definition: Character.h:247
static bool isISOControl(char c)
Answers whether the character is an ISO control character, which is a char that lays in the range of ...
Definition: Character.h:265
virtual int compareTo(const Character &c) const
Compares this Character instance with another.
Definition: Character.h:69
static char toLowerCase(char value)
Returns the lower case equivalent for the specified character if the character is an upper case lette...
Definition: Character.h:304
static char toUpperCase(char value)
Returns the upper case equivalent for the specified character if the character is a lower case letter...
Definition: Character.h:322
bool equals(const char &c) const
Definition: Character.h:133
bool equals(const Character &c) const
Definition: Character.h:126
virtual int compareTo(const char &c) const
Compares this Character instance with a char type.
Definition: Character.h:100
static bool isLowerCase(char c)
Indicates whether or not the given character is a lower case character.
Definition: Character.h:231
virtual int intValue() const
Answers the int value which the receiver represents.
Definition: Character.h:178
virtual bool operator==(const Character &c) const
Compares equality between this object and the one passed.
Definition: Character.h:78
virtual bool operator<(const Character &c) const
Compares this object to another and returns true if this object is considered to be less than the one...
Definition: Character.h:88
virtual bool operator==(const char &c) const
Compares equality between this object and the one passed.
Definition: Character.h:109
virtual double doubleValue() const
Answers the double value which the receiver represents.
Definition: Character.h:146
The abstract class Number is the superclass of classes Byte, Double, Float, Integer, Long, and Short.
Definition: Number.h:35
static bool isUpperCase(char c)
Indicates whether or not the given character is a upper case character.
Definition: Character.h:239
static Character valueOf(char value)
Returns a Character instance representing the specified char value.
Definition: Character.h:197
static bool isWhitespace(char c)
Indicates whether or not the given character is considered whitespace.
Definition: Character.h:205
#define DECAF_API
Definition: Config.h:29
virtual float floatValue() const
Answers the float value which the receiver represents.
Definition: Character.h:154
Definition: Character.h:29
virtual long long longValue() const
Answers the long value which the receiver represents.
Definition: Character.h:186
virtual bool operator<(const char &c) const
Compares this object to another and returns true if this object is considered to be less than the one...
Definition: Character.h:119
static bool isLetterOrDigit(char c)
Indicates whether or not the given character is either a letter or a digit.
Definition: Character.h:255
This interface imposes a total ordering on the objects of each class that implements it...
Definition: Comparable.h:33
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements...
Definition: AprPool.h:25
virtual unsigned char byteValue() const
Answers the byte value which the receiver represents.
Definition: Character.h:162