Chapter 16: Exploring java.lang 393
Method Description
static int bitCount(intnum) Returns the number of set bits innum.
byte byteValue( ) Returns the value of the invoking object as abyte.
int compareTo(Integeri) Compares the numerical value of the invoking object
with that ofi.Returns 0 if the values are equal.
Returns a negative value if the invoking object has a
lower value. Returns a positive value if the invoking
object has a greater value.
static Integer decode(Stringstr)
throws NumberFormatException
Returns anIntegerobject that contains the value
specified by the string instr.
double doubleValue( ) Returns the value of the invoking object as adouble.
boolean equals(ObjectIntegerObj) Returnstrueif the invokingIntegerobject is
equivalent toIntegerObj.Other wise, it returnsfalse.
float floatValue( ) Returns the value of the invoking object as afloat.
static Integer
getInteger(StringpropertyName)
Returns the value associated with the environmental
property specified bypropertyName.Anullis
returned on failure.
static Integer
getInteger(StringpropertyName,
intdefault)
Returns the value associated with the environmental
property specified bypropertyName.The value of
defaultis returned on failure.
static Integer
getInteger(StringpropertyName,
Integerdefault)
Returns the value associated with the environmental
property specified bypropertyName.The value of
defaultis returned on failure.
int hashCode( ) Returns the hash code for the invoking object.
static int highestOneBit(intnum) Determines the position of the highest order set bit
innum.It returns a value in which only this bit is set.
If no bit is set to one, then zero is returned.
int intValue( ) Returns the value of the invoking object as anint.
long longValue( ) Returns the value of the invoking object as along.
static int lowestOneBit(intnum) Determines the position of the lowest order set bit in
num.It returns a value in which only this bit is set. If
no bit is set to one, then zero is returned.
static int numberOfLeadingZeros(intnum) Returns the number of high-order zero bits that precede
the first high-order set bit innum.Ifnumis zero, 32 is
returned.
TABLE 16-5 The Methods Defined byInteger