| java.lang.Object | ||
| ↳ | java.lang.Number | |
| ↳ | java.lang.Integer | |
Integer is the wrapper for the primitive type int.
As with the specification, this implementation relied on code laid out in Henry S. Warren, Jr.'s Hacker's Delight, (Addison Wesley, 2002) as well as The Aggregate's Magic Algorithms.
| Constants | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| int | MAX_VALUE |
Constant for the maximum |
|||||||||
| int | MIN_VALUE |
Constant for the minimum |
|||||||||
| int | SIZE |
Constant for the number of bits to represent an |
|||||||||
| Class<Integer> | TYPE | The java.lang.Class that represents this class. | |||||||||
| Public Constructors | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Constructs a new instance of the receiver which represents the int valued
argument.
| |||||||||||
Constructs a new instance of this class given a string.
| |||||||||||
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Counts the number of 1 bits in the | |||||||||||
Returns the byte value which the receiver represents
| |||||||||||
Compares this | |||||||||||
Parses the string argument as if it was an int value and returns the
result.
| |||||||||||
Returns the double value which the receiver represents
| |||||||||||
Compares the argument to the receiver, and returns true if they represent
the same object using a class specific comparison.
| |||||||||||
Returns the float value which the receiver represents
| |||||||||||
Returns an Integer representing the integer value of the property named
by the argument.
| |||||||||||
Returns an Integer representing the integer value of the property named
by the argument.
| |||||||||||
Returns an Integer representing the integer value of the property named
by the argument.
| |||||||||||
Returns an integer hash code for the receiver.
| |||||||||||
Determines the highest (leftmost) bit that is 1 and returns the value that is the bit mask for that bit. | |||||||||||
Returns the int value which the receiver represents
| |||||||||||
Returns the long value which the receiver represents
| |||||||||||
Determines the lowest (rightmost) bit that is 1 and returns the value that is the bit mask for that bit. | |||||||||||
Determines the number of leading zeros in the | |||||||||||
Determines the number of trailing zeros in the | |||||||||||
Parses the string argument as if it was an int value and returns the
result.
| |||||||||||
Parses the string argument as if it was an int value and returns the
result.
| |||||||||||
Reverses the bytes of a | |||||||||||
Reverses the bytes of a | |||||||||||
Rotates the bits of | |||||||||||
Rotates the bits of | |||||||||||
Returns the short value which the receiver represents
| |||||||||||
The | |||||||||||
Returns a string containing '0' and '1' characters which describe the
binary representation of the argument.
| |||||||||||
Returns a string containing characters in the range 0..9, a..f which
describe the hexadecimal representation of the argument.
| |||||||||||
Returns a string containing characters in the range 0..7 which describe
the octal representation of the argument.
| |||||||||||
Returns a string containing characters in the range 0..9, a..z (depending
on the radix) which describe the representation of the argument in that
radix.
| |||||||||||
Returns a string containing a concise, human-readable description of the
receiver.
| |||||||||||
Returns a string containing characters in the range 0..9 which describe
the decimal representation of the argument.
| |||||||||||
Parses the string argument as if it was an int value and returns the
result.
| |||||||||||
Parses the string argument as if it was an int value and returns the
result.
| |||||||||||
Returns a | |||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class java.lang.Number
| |||||||||||
From class java.lang.Object
| |||||||||||
From interface java.lang.Comparable
| |||||||||||
Constant for the maximum int value, 231-1.
Constant for the minimum int value, -231.
Constant for the number of bits to represent an int in
two's compliment form.
Constructs a new instance of the receiver which represents the int valued argument.
| value | the int to store in the new instance. |
|---|
Constructs a new instance of this class given a string.
| string | a string representation of an int quantity. |
|---|
| NumberFormatException | if the argument could not be parsed as an int quantity. |
|---|
Counts the number of 1 bits in the int value passed; this
is sometimes referred to as a population count.
| i | The int value to process. |
|---|
Returns the byte value which the receiver represents
Compares this Integer to the Integer
passed. If this instance's value is equal to the value of the instance
passed, then 0 is returned. If this instance's value is less than the
value of the instance passed, then a negative value is returned. If this
instance's value is greater than the value of the instance passed, then a
positive value is returned.
| object | The instance to compare to. |
|---|
| NullPointerException | if object is null. |
|---|
Parses the string argument as if it was an int value and returns the result. Throws NumberFormatException if the string does not represent an int quantity. The string may be a hexadecimal ("0x..."), octal ("0..."), or decimal ("...") representation of an integer
| string | a string representation of an int quantity. |
|---|
| NumberFormatException | if the argument could not be parsed as an int quantity. |
|---|
Returns the double value which the receiver represents
Compares the argument to the receiver, and returns true if they represent the same object using a class specific comparison.
In this case, the argument must also be an Integer, and the receiver and argument must represent the same int value.
| o | the object to compare with this object |
|---|
true if the object is the same as this object
false if it is different from this objectReturns the float value which the receiver represents
Returns an Integer representing the integer value of the property named by the argument. If the property could not be found, or its value could not be parsed as an integer, answer null.
| string | The name of the desired integer property. |
|---|
Returns an Integer representing the integer value of the property named by the argument. If the property could not be found, or its value could not be parsed as an integer, answer an Integer representing the second argument.
| string | The name of the desired integer property. |
|---|
Returns an Integer representing the integer value of the property named by the argument. If the property could not be found, or its value could not be parsed as an integer, answer the second argument.
| string | The name of the desired integer property. |
|---|
Returns an integer hash code for the receiver. Any two objects which
answer true when passed to equals must
answer the same value for this method.
Determines the highest (leftmost) bit that is 1 and returns the value that is the bit mask for that bit. This is sometimes referred to as the Most Significant 1 Bit.
| i | The int to interrogate. |
|---|
Returns the int value which the receiver represents
Returns the long value which the receiver represents
Determines the lowest (rightmost) bit that is 1 and returns the value that is the bit mask for that bit. This is sometimes referred to as the Least Significant 1 Bit.
| i | The int to interrogate. |
|---|
Determines the number of leading zeros in the int passed
prior to the highest one bit.
| i | The int to process. |
|---|
Determines the number of trailing zeros in the int passed
after the lowest one bit.
| i | The int to process. |
|---|
Parses the string argument as if it was an int value and returns the result. Throws NumberFormatException if the string does not represent an int quantity.
| string | a string representation of an int quantity. |
|---|
| NumberFormatException | if the argument could not be parsed as an int quantity. |
|---|
Parses the string argument as if it was an int value and returns the result. Throws NumberFormatException if the string does not represent an int quantity. The second argument specifies the radix to use when parsing the value.
| string | a string representation of an int quantity. |
|---|---|
| radix | the base to use for conversion. |
| NumberFormatException | if the argument could not be parsed as an int quantity. |
|---|
Reverses the bytes of a int.
| i | The int to reverse. |
|---|
Reverses the bytes of a int.
| i | The int to reverse. |
|---|
Rotates the bits of i to the left by the
distance bits.
| i | The int value to rotate left. |
|---|---|
| distance | The number of bits to rotate. |
Rotates the bits of i to the right by the
distance bits.
| i | The int value to rotate right. |
|---|---|
| distance | The number of bits to rotate. |
Returns the short value which the receiver represents
The signum function for int values. This
method returns -1 for negative values, 1 for positive values and 0 for
the value 0.
| i | The int value. |
|---|
Returns a string containing '0' and '1' characters which describe the binary representation of the argument.
| i | an int to get the binary representation of |
|---|
Returns a string containing characters in the range 0..9, a..f which describe the hexadecimal representation of the argument.
| i | an int to get the hex representation of |
|---|
Returns a string containing characters in the range 0..7 which describe the octal representation of the argument.
| i | an int to get the octal representation of |
|---|
Returns a string containing characters in the range 0..9, a..z (depending on the radix) which describe the representation of the argument in that radix.
| i | an int to get the representation of |
|---|---|
| radix | the base to use for conversion. |
Returns a string containing a concise, human-readable description of the receiver.
Returns a string containing characters in the range 0..9 which describe the decimal representation of the argument.
| i | an int to get the representation of |
|---|
Parses the string argument as if it was an int value and returns the result. Throws NumberFormatException if the string does not represent an int quantity. The second argument specifies the radix to use when parsing the value.
| string | a string representation of an int quantity. |
|---|---|
| radix | the base to use for conversion. |
| NumberFormatException | if the argument could not be parsed as an int quantity. |
|---|
Parses the string argument as if it was an int value and returns the result. Throws NumberFormatException if the string does not represent an int quantity.
| string | a string representation of an int quantity. |
|---|
| NumberFormatException | if the argument could not be parsed as an int quantity. |
|---|
Returns a Integer instance for the int
value passed. This method is preferred over the constructor, as this
method may maintain a cache of instances.
| i | The int value. |
|---|
Integer instance.