18 #ifndef _DECAF_LANG_INTEGER_H_ 19 #define _DECAF_LANG_INTEGER_H_ 67 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;
217 static Integer decode(
const std::string& value);
225 static int reverseBytes(
int value);
233 static int reverse(
int value);
258 static int parseInt(
const std::string& s,
int radix);
271 static int parseInt(
const std::string& s);
292 static Integer valueOf(
const std::string& value);
306 static Integer valueOf(
const std::string& value,
int radix);
316 static int bitCount(
int value);
324 static std::string toString(
int value);
349 static std::string toString(
int value,
int radix);
370 static std::string toHexString(
int value);
390 static std::string toOctalString(
int value);
409 static std::string toBinaryString(
int value);
421 static int highestOneBit(
int value);
433 static int lowestOneBit(
int value);
452 static int numberOfLeadingZeros(
int value);
464 static int numberOfTrailingZeros(
int value);
483 static int rotateLeft(
int value,
int distance);
502 static int rotateRight(
int value,
int distance);
511 static int signum(
int value);
515 static int parse(
const std::string& value,
int offset,
int radix,
bool negative);
virtual int intValue() const
Answers the int value which the receiver represents.
Definition: Integer.h:187
static Integer valueOf(int value)
Returns a Integer instance representing the specified int value.
Definition: Integer.h:278
bool equals(const int &i) const
Definition: Integer.h:123
static const int MIN_VALUE
The minimum value that the primitive type can hold.
Definition: Integer.h:47
virtual bool operator==(const int &i) const
Compares equality between this object and the one passed.
Definition: Integer.h:132
virtual long long longValue() const
Answers the long value which the receiver represents.
Definition: Integer.h:195
virtual unsigned char byteValue() const
Answers the byte value which the receiver represents.
Definition: Integer.h:171
bool equals(const Integer &i) const
Definition: Integer.h:86
virtual bool operator==(const Integer &i) const
Compares equality between this object and the one passed.
Definition: Integer.h:95
The abstract class Number is the superclass of classes Byte, Double, Float, Integer, Long, and Short.
Definition: Number.h:35
virtual ~Integer()
Definition: Integer.h:69
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 float floatValue() const
Answers the float value which the receiver represents.
Definition: Integer.h:163
virtual double doubleValue() const
Answers the double value which the receiver represents.
Definition: Integer.h:155
#define DECAF_API
Definition: Config.h:29
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 short shortValue() const
Answers the short value which the receiver represents.
Definition: Integer.h:179
static const int MAX_VALUE
The maximum value that the primitive type can hold.
Definition: Integer.h:44
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
static const int SIZE
The size in bits of the primitive int type.
Definition: Integer.h:41