| java.lang.Object java.lang.Number java.lang.Integer
Inner Class :static class valueOfCache | |
Field Summary | |
final public static int | MAX_VALUE
Constant for the maximum int value, 231-1. | final public static int | MIN_VALUE
Constant for the minimum int value, -231. | final public static int | SIZE
Constant for the number of bits to represent an int in
two's compliment form. | final public static Class<Integer> | TYPE The java.lang.Class that represents this class. |
Constructor Summary | |
public | Integer(int value) Constructs a new instance of the receiver which represents the int valued
argument. | public | Integer(String string) Constructs a new instance of this class given a string. |
Method Summary | |
public static int | bitCount(int i)
Counts the number of 1 bits in the int value passed; this
is sometimes referred to as a population count.
Parameters: i - The int value to process. | public byte | byteValue() | public int | compareTo(Integer object)
Compares this Integer to the Integer
passed. | public static Integer | decode(String string) Parses the string argument as if it was an int value and returns the
result. | public double | doubleValue() | public boolean | equals(Object o) Compares the argument to the receiver, and answers true if they represent
the same object using a class specific comparison. | public float | floatValue() | public static Integer | getInteger(String string) Answers an Integer representing the integer value of the property named
by the argument. | public static Integer | getInteger(String string, int defaultValue) Answers an Integer representing the integer value of the property named
by the argument. | public static Integer | getInteger(String string, Integer defaultValue) Answers an Integer representing the integer value of the property named
by the argument. | public int | hashCode() Answers an integer hash code for the receiver. | public static int | highestOneBit(int i)
Determines the highest (leftmost) bit that is 1 and returns the value
that is the bit mask for that bit. | public int | intValue() | public long | longValue() | public static int | lowestOneBit(int i)
Determines the lowest (rightmost) bit that is 1 and returns the value
that is the bit mask for that bit. | public static int | numberOfLeadingZeros(int i)
Determines the number of leading zeros in the int passed
prior to the
Integer.highestOneBit(int) highest one bit .
Parameters: i - The int to process. | public static int | numberOfTrailingZeros(int i)
Determines the number of trailing zeros in the int passed
after the
Integer.lowestOneBit(int) lowest one bit .
Parameters: i - The int to process. | public static int | parseInt(String string) Parses the string argument as if it was an int value and returns the
result. | public static int | parseInt(String string, int radix) Parses the string argument as if it was an int value and returns the
result. | public static int | reverse(int i)
Reverses the bytes of a int .
Parameters: i - The int to reverse. | public static int | reverseBytes(int i)
Reverses the bytes of a int .
Parameters: i - The int to reverse. | public static int | rotateLeft(int i, int distance)
Rotates the bits of i to the left by the
distance bits.
Parameters: i - The int value to rotate left. Parameters: distance - The number of bits to rotate. | public static int | rotateRight(int i, int distance)
Rotates the bits of i to the right by the
distance bits.
Parameters: i - The int value to rotate right. Parameters: distance - The number of bits to rotate. | public short | shortValue() | public static int | signum(int i)
The signum function for int values. | public static String | toBinaryString(int i) Answers a string containing '0' and '1' characters which describe the
binary representation of the argument. | public static String | toHexString(int i) Answers a string containing characters in the range 0..9, a..f which
describe the hexadecimal representation of the argument. | public static String | toOctalString(int i) Answers a string containing characters in the range 0..7 which describe
the octal representation of the argument. | public String | toString() Answers a string containing a concise, human-readable description of the
receiver. | public static String | toString(int i) Answers a string containing characters in the range 0..9 which describe
the decimal representation of the argument. | public static String | toString(int i, int radix) Answers 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.
Parameters: i - an int to get the representation of Parameters: radix - the base to use for conversion. | public static Integer | valueOf(String string) Parses the string argument as if it was an int value and returns the
result. | public static Integer | valueOf(String string, int radix) Parses the string argument as if it was an int value and returns the
result. | public static Integer | valueOf(int i)
Returns a Integer instance for the int
value passed. |
MAX_VALUE | final public static int MAX_VALUE(Code) | |
Constant for the maximum int value, 231-1.
|
MIN_VALUE | final public static int MIN_VALUE(Code) | |
Constant for the minimum int value, -231.
|
SIZE | final public static int SIZE(Code) | |
Constant for the number of bits to represent an int in
two's compliment form.
since: 1.5 |
TYPE | final public static Class<Integer> TYPE(Code) | | The java.lang.Class that represents this class.
|
Integer | public Integer(int value)(Code) | | Constructs a new instance of the receiver which represents the int valued
argument.
Parameters: value - the int to store in the new instance. |
Integer | public Integer(String string) throws NumberFormatException(Code) | | Constructs a new instance of this class given a string.
Parameters: string - a string representation of an int quantity. exception: NumberFormatException - if the argument could not be parsed as an int quantity. |
bitCount | public static int bitCount(int i)(Code) | |
Counts the number of 1 bits in the int value passed; this
is sometimes referred to as a population count.
Parameters: i - The int value to process. The number of 1 bits. since: 1.5 |
byteValue | public byte byteValue()(Code) | | Answers the byte value which the receiver represents
byte the value of the receiver. |
compareTo | public int compareTo(Integer object)(Code) | |
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.
Parameters: object - The instance to compare to. throws: NullPointerException - if object is null . since: 1.2 |
decode | public static Integer decode(String string) throws NumberFormatException(Code) | | 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
Parameters: string - a string representation of an int quantity. Integer the value represented by the argument exception: NumberFormatException - if the argument could not be parsed as an int quantity. |
doubleValue | public double doubleValue()(Code) | | Answers the double value which the receiver represents
double the value of the receiver. |
equals | public boolean equals(Object o)(Code) | | Compares the argument to the receiver, and answers 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.
Parameters: o - the object to compare with this object true if the object is the same as this objectfalse if it is different from this object See Also: Integer.hashCode |
floatValue | public float floatValue()(Code) | | Answers the float value which the receiver represents
float the value of the receiver. |
getInteger | public static Integer getInteger(String string)(Code) | | Answers 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.
Parameters: string - The name of the desired integer property. Integer An Integer representing the value of the property. |
getInteger | public static Integer getInteger(String string, int defaultValue)(Code) | | Answers 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.
Parameters: string - The name of the desired integer property. Integer An Integer representing the value of the property. |
getInteger | public static Integer getInteger(String string, Integer defaultValue)(Code) | | Answers 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.
Parameters: string - The name of the desired integer property. Integer An Integer representing the value of the property. |
hashCode | public int hashCode()(Code) | | Answers 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.
the receiver's hash See Also: Integer.equals |
highestOneBit | public static int highestOneBit(int i)(Code) | |
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.
Parameters: i - The int to interrogate. The bit mask indicating the highest 1 bit. since: 1.5 |
intValue | public int intValue()(Code) | | Answers the int value which the receiver represents
int the value of the receiver. |
longValue | public long longValue()(Code) | | Answers the long value which the receiver represents
long the value of the receiver. |
lowestOneBit | public static int lowestOneBit(int i)(Code) | |
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.
Parameters: i - The int to interrogate. The bit mask indicating the lowest 1 bit. since: 1.5 |
numberOfLeadingZeros | public static int numberOfLeadingZeros(int i)(Code) | |
Determines the number of leading zeros in the int passed
prior to the
Integer.highestOneBit(int) highest one bit .
Parameters: i - The int to process. The number of leading zeros. since: 1.5 |
numberOfTrailingZeros | public static int numberOfTrailingZeros(int i)(Code) | |
Determines the number of trailing zeros in the int passed
after the
Integer.lowestOneBit(int) lowest one bit .
Parameters: i - The int to process. The number of trailing zeros. since: 1.5 |
parseInt | public static int parseInt(String string) throws NumberFormatException(Code) | | 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.
Parameters: string - a string representation of an int quantity. int the value represented by the argument exception: NumberFormatException - if the argument could not be parsed as an int quantity. |
parseInt | public static int parseInt(String string, int radix) throws NumberFormatException(Code) | | 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.
Parameters: string - a string representation of an int quantity. Parameters: radix - the base to use for conversion. int the value represented by the argument exception: NumberFormatException - if the argument could not be parsed as an int quantity. |
reverse | public static int reverse(int i)(Code) | |
Reverses the bytes of a int .
Parameters: i - The int to reverse. The reversed value. since: 1.5 |
reverseBytes | public static int reverseBytes(int i)(Code) | |
Reverses the bytes of a int .
Parameters: i - The int to reverse. The reversed value. since: 1.5 |
rotateLeft | public static int rotateLeft(int i, int distance)(Code) | |
Rotates the bits of i to the left by the
distance bits.
Parameters: i - The int value to rotate left. Parameters: distance - The number of bits to rotate. The rotated value. since: 1.5 |
rotateRight | public static int rotateRight(int i, int distance)(Code) | |
Rotates the bits of i to the right by the
distance bits.
Parameters: i - The int value to rotate right. Parameters: distance - The number of bits to rotate. The rotated value. since: 1.5 |
shortValue | public short shortValue()(Code) | | Answers the short value which the receiver represents
short the value of the receiver. |
signum | public static int signum(int i)(Code) | |
The signum function for int values. This
method returns -1 for negative values, 1 for positive values and 0 for
the value 0.
Parameters: i - The int value. -1 if negative, 1 if positive otherwise 0. since: 1.5 |
toBinaryString | public static String toBinaryString(int i)(Code) | | Answers a string containing '0' and '1' characters which describe the
binary representation of the argument.
Parameters: i - an int to get the binary representation of String the binary representation of the argument |
toHexString | public static String toHexString(int i)(Code) | | Answers a string containing characters in the range 0..9, a..f which
describe the hexadecimal representation of the argument.
Parameters: i - an int to get the hex representation of String the hex representation of the argument |
toOctalString | public static String toOctalString(int i)(Code) | | Answers a string containing characters in the range 0..7 which describe
the octal representation of the argument.
Parameters: i - an int to get the octal representation of String the hex representation of the argument |
toString | public String toString()(Code) | | Answers a string containing a concise, human-readable description of the
receiver.
a printable representation for the receiver. |
toString | public static String toString(int i)(Code) | | Answers a string containing characters in the range 0..9 which describe
the decimal representation of the argument.
Parameters: i - an int to get the representation of String the representation of the argument |
toString | public static String toString(int i, int radix)(Code) | | Answers 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.
Parameters: i - an int to get the representation of Parameters: radix - the base to use for conversion. String the representation of the argument |
valueOf | public static Integer valueOf(String string) throws NumberFormatException(Code) | | 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.
Parameters: string - a string representation of an int quantity. Integer the value represented by the argument exception: NumberFormatException - if the argument could not be parsed as an int quantity. |
valueOf | public static Integer valueOf(String string, int radix) throws NumberFormatException(Code) | | 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.
Parameters: string - a string representation of an int quantity. Parameters: radix - the base to use for conversion. Integer the value represented by the argument exception: NumberFormatException - if the argument could not be parsed as an int quantity. |
valueOf | public static Integer valueOf(int i)(Code) | |
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.
Parameters: i - The int value. A Integer instance. since: 1.5 |
|
|