18 #ifndef _DECAF_LANG_BYTE_H_
19 #define _DECAF_LANG_BYTE_H_
54 Byte(
unsigned char value);
77 return this->value < c.value ? -1 : (this->value > c.value) ? 1 : 0;
86 return this->value == c.value;
96 return this->value < c.value;
108 return this->value < c ? -1 : (this->value > c) ? 1 : 0;
117 return this->value == c;
127 return this->value < c;
134 return this->value == c.value;
140 bool equals(
const unsigned char& c)
const {
141 return this->value == c;
147 std::string toString()
const;
154 return (
double) this->value;
162 return (
float) this->value;
178 return (
short) this->value;
186 return (
int) this->value;
194 return (
long long) this->value;
202 static std::string toString(
unsigned char value);
253 static unsigned char parseByte(
const String& s,
int radix);
270 static unsigned char parseByte(
const String& s);
316 static Byte valueOf(
const String& value,
int radix);
unsigned char Byte
Definition: zconf.h:335
virtual bool operator<(const Byte &c) const
Compares this object to another and returns true if this object is considered to be less than the one...
Definition: Byte.h:95
bool equals(const unsigned char &c) const
Definition: Byte.h:140
static const int SIZE
The size of the primitive character in bits.
Definition: Byte.h:47
virtual long long longValue() const
Answers the long value which the receiver represents.
Definition: Byte.h:193
virtual int intValue() const
Answers the int value which the receiver represents.
Definition: Byte.h:185
static Byte valueOf(unsigned char value)
Returns a Character instance representing the specified char value.
Definition: Byte.h:280
virtual bool operator==(const unsigned char &c) const
Compares equality between this object and the one passed.
Definition: Byte.h:116
bool equals(const Byte &c) const
Definition: Byte.h:133
virtual double doubleValue() const
Answers the double value which the receiver represents.
Definition: Byte.h:153
The abstract class Number is the superclass of classes Byte, Double, Float, Integer, Long, and Short.
Definition: Number.h:35
static const unsigned char MAX_VALUE
The maximum value that a unsigned char can take on.
Definition: Byte.h:44
virtual ~Byte()
Definition: Byte.h:66
virtual float floatValue() const
Answers the float value which the receiver represents.
Definition: Byte.h:161
virtual int compareTo(const Byte &c) const
Compares this Byte instance with another.
Definition: Byte.h:76
virtual bool operator==(const Byte &c) const
Compares equality between this object and the one passed.
Definition: Byte.h:85
An immutable sequence of characters.
Definition: String.h:57
virtual unsigned char byteValue() const
Answers the byte value which the receiver represents.
Definition: Byte.h:169
virtual short shortValue() const
Answers the short value which the receiver represents.
Definition: Byte.h:177
#define DECAF_API
Definition: Config.h:29
virtual int compareTo(const unsigned char &c) const
Compares this Byte instance with a char type.
Definition: Byte.h:107
virtual bool operator<(const unsigned char &c) const
Compares this object to another and returns true if this object is considered to be less than the one...
Definition: Byte.h:126
static const unsigned char MIN_VALUE
The minimum value that a unsigned char can take on.
Definition: Byte.h:41
This interface imposes a total ordering on the objects of each class that implements it...
Definition: Comparable.h:33