18 #ifndef _DECAF_LANG_INTEGER_H_
19 #define _DECAF_LANG_INTEGER_H_
68 Integer(
const std::string& value);
80 virtual int compareTo(
const Integer& i)
const;
87 return this->value == i.value;
96 return this->value == i.value;
106 return this->value < i.value;
117 virtual int compareTo(
const int& i)
const;
124 return this->value == i;
133 return this->value == i;
143 return this->value < i;
149 std::string toString()
const;
156 return (
double) this->value;
164 return (
float) this->value;
172 return (
unsigned char) this->value;
180 return (
short) this->value;
196 return (
long long) this->value;
225 static int reverseBytes(
int value);
233 static int reverse(
int value);
258 static int parseInt(
const String& s,
int radix);
274 static int parseInt(
const String& s);
322 static int bitCount(
int value);
330 static std::string toString(
int value);
355 static std::string toString(
int value,
int radix);
376 static std::string toHexString(
int value);
396 static std::string toOctalString(
int value);
415 static std::string toBinaryString(
int value);
427 static int highestOneBit(
int value);
439 static int lowestOneBit(
int value);
458 static int numberOfLeadingZeros(
int value);
470 static int numberOfTrailingZeros(
int value);
489 static int rotateLeft(
int value,
int distance);
508 static int rotateRight(
int value,
int distance);
517 static int signum(
int value);
521 static int parse(
const String& value,
int offset,
int radix,
bool negative);
static Integer valueOf(int value)
Returns a Integer instance representing the specified int value.
Definition: Integer.h:284
static const int MIN_VALUE
The minimum value that the primitive type can hold.
Definition: Integer.h:48
bool equals(const Integer &i) const
Definition: Integer.h:86
virtual bool operator<(const Integer &i) const
Compares this object to another and returns true if this object is considered to be less than the one...
Definition: Integer.h:105
virtual unsigned char byteValue() const
Answers the byte value which the receiver represents.
Definition: Integer.h:171
virtual float floatValue() const
Answers the float value which the receiver represents.
Definition: Integer.h:163
The abstract class Number is the superclass of classes Byte, Double, Float, Integer, Long, and Short.
Definition: Number.h:35
virtual double doubleValue() const
Answers the double value which the receiver represents.
Definition: Integer.h:155
virtual int intValue() const
Answers the int value which the receiver represents.
Definition: Integer.h:187
virtual bool operator<(const int &i) const
Compares this object to another and returns true if this object is considered to be less than the one...
Definition: Integer.h:142
virtual bool operator==(const int &i) const
Compares equality between this object and the one passed.
Definition: Integer.h:132
virtual short shortValue() const
Answers the short value which the receiver represents.
Definition: Integer.h:179
An immutable sequence of characters.
Definition: String.h:57
#define DECAF_API
Definition: Config.h:29
static const int MAX_VALUE
The maximum value that the primitive type can hold.
Definition: Integer.h:45
virtual bool operator==(const Integer &i) const
Compares equality between this object and the one passed.
Definition: Integer.h:95
virtual long long longValue() const
Answers the long value which the receiver represents.
Definition: Integer.h:195
This interface imposes a total ordering on the objects of each class that implements it...
Definition: Comparable.h:33
static const int SIZE
The size in bits of the primitive int type.
Definition: Integer.h:42
bool equals(const int &i) const
Definition: Integer.h:123