18#ifndef _DECAF_LANG_INTEGER_H_
19#define _DECAF_LANG_INTEGER_H_
87 return this->value == i.value;
96 return this->value == i.value;
106 return this->value < i.value;
124 return this->value == i;
133 return this->value == i;
143 return this->value < i;
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;
521 static int parse(
const String& value,
int offset,
int radix,
bool negative);
This interface imposes a total ordering on the objects of each class that implements it.
Definition Comparable.h:33
virtual unsigned char byteValue() const
Answers the byte value which the receiver represents.
Definition Integer.h:171
static int signum(int value)
Returns the signum function of the specified int value.
static int parseInt(const String &s)
Parses the string argument as a signed decimal int.
static std::string toBinaryString(int value)
Returns a string representation of the integer argument as an unsigned integer in base 2.
virtual int compareTo(const int &i) const
Compares this Integer instance with another.
virtual int intValue() const
Answers the int value which the receiver represents.
Definition Integer.h:187
Integer(const std::string &value)
Constructs a new Integer and attempts to convert the given string to an int value,...
static int rotateLeft(int value, int distance)
Returns the value obtained by rotating the two's complement binary representation of the specified in...
static int bitCount(int value)
Returns the number of one-bits in the two's complement binary representation of the specified int val...
static std::string toString(int value)
Converts the int to a String representation.
virtual int compareTo(const Integer &i) const
Compares this Integer instance with another.
static int parseInt(const String &s, int radix)
Parses the string argument as a signed int in the radix specified by the second argument.
virtual bool operator==(const Integer &i) const
Compares equality between this object and the one passed.
Definition Integer.h:95
static std::string toOctalString(int value)
Returns a string representation of the integer argument as an unsigned integer in base 8.
static Integer valueOf(const String &value)
Returns a Integer object holding the value given by the specified std::string.
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
static int numberOfTrailingZeros(int value)
Returns the number of zero bits following the lowest-order ("rightmost") one-bit in the two's complem...
virtual bool operator==(const int &i) const
Compares equality between this object and the one passed.
Definition Integer.h:132
static std::string toHexString(int value)
Returns a string representation of the integer argument as an unsigned integer in base 16.
static Integer valueOf(const String &value, int radix)
Returns a Integer object holding the value extracted from the specified std::string when parsed with ...
static int lowestOneBit(int value)
Returns an int value with at most a single one-bit, in the position of the lowest-order ("rightmost")...
virtual long long longValue() const
Answers the long value which the receiver represents.
Definition Integer.h:195
static Integer valueOf(int value)
Returns a Integer instance representing the specified int value.
Definition Integer.h:284
virtual double doubleValue() const
Answers the double value which the receiver represents.
Definition Integer.h:155
virtual float floatValue() const
Answers the float value which the receiver represents.
Definition Integer.h:163
bool equals(const Integer &i) const
Definition Integer.h:86
static const int MAX_VALUE
The maximum value that the primitive type can hold.
Definition Integer.h:45
static int highestOneBit(int value)
Returns an int value with at most a single one-bit, in the position of the highest-order ("leftmost")...
static int numberOfLeadingZeros(int value)
Returns the number of zero bits preceding the highest-order ("leftmost") one-bit in the two's complem...
bool equals(const int &i) const
Definition Integer.h:123
static Integer decode(const String &value)
Decodes a String into a Integer.
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
static std::string toString(int value, int radix)
Returns a string representation of the first argument in the radix specified by the second argument.
static int rotateRight(int value, int distance)
Returns the value obtained by rotating the two's complement binary representation of the specified in...
static const int MIN_VALUE
The minimum value that the primitive type can hold.
Definition Integer.h:48
virtual short shortValue() const
Answers the short value which the receiver represents.
Definition Integer.h:179
static int reverseBytes(int value)
Returns the value obtained by reversing the order of the bytes in the two's complement representation...
static int reverse(int value)
Returns the value obtained by reversing the order of the bits in the two's complement binary represen...
static const int SIZE
The size in bits of the primitive int type.
Definition Integer.h:42
std::string toString() const
The abstract class Number is the superclass of classes Byte, Double, Float, Integer,...
Definition Number.h:35
An immutable sequence of characters.
Definition String.h:57
#define DECAF_API
Definition Config.h:29
Definition ThreadingTypes.h:31
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.
Definition AprPool.h:25