public final class Integer extends Number implements Comparable<Integer>
| Modifier and Type | Field and Description |
|---|---|
static int |
MAX_VALUE
The largest value of type int.
|
static int |
MIN_VALUE
The smallest value of type int.
|
static Class<Integer> |
TYPE |
| Constructor and Description |
|---|
Integer(int value)
Constructs a newly allocated Integer object that represents the primitive int argument.
|
| Modifier and Type | Method and Description |
|---|---|
byte |
byteValue()
Returns the value of this Integer as a byte.
|
static int |
compare(int i1,
int i2) |
int |
compareTo(Integer i)
Compares this object to the specified object to determine their relative
order.
|
double |
doubleValue()
Returns the value of this Integer as a double.
|
boolean |
equals(Object obj)
Compares this object to the specified object.
|
float |
floatValue()
Returns the value of this Integer as a float.
|
int |
hashCode()
Returns a hashcode for this Integer.
|
int |
intValue()
Returns the value of this Integer as an int.
|
long |
longValue()
Returns the value of this Integer as a long.
|
static int |
numberOfLeadingZeros(int i) |
static int |
parseInt(String s)
Parses the string argument as a signed decimal integer.
|
static int |
parseInt(String s,
int radix)
Parses the string argument as a signed integer in the radix specified by the second argument.
|
short |
shortValue()
Returns the value of this Integer as a short.
|
static int |
signum(int i)
Returns the value of the
signum function for the specified
integer. |
static String |
toBinaryString(int i)
Creates a string representation of the integer argument as an unsigned integer in base
2.
|
static String |
toHexString(int i)
Creates a string representation of the integer argument as an unsigned integer in base
16.
|
static String |
toOctalString(int i)
Creates a string representation of the integer argument as an unsigned integer in base 8.
|
String |
toString()
Returns a String object representing this Integer's value.
|
static String |
toString(int i)
Returns a new String object representing the specified integer.
|
static String |
toString(int i,
int radix)
Creates a string representation of the first argument in the radix specified by the second argument.
|
static Integer |
valueOf(int i)
Returns the object instance of i
|
static Integer |
valueOf(String s)
Returns a new Integer object initialized to the value of the specified String.
|
static Integer |
valueOf(String s,
int radix)
Returns a new Integer object initialized to the value of the specified String.
|
public static final int MAX_VALUE
public static final int MIN_VALUE
public Integer(int value)
public byte byteValue()
public double doubleValue()
doubleValue in class Numberpublic boolean equals(Object obj)
public float floatValue()
floatValue in class Numberpublic int hashCode()
public int intValue()
public long longValue()
public static int parseInt(String s) throws NumberFormatException
NumberFormatExceptionpublic static int parseInt(String s, int radix) throws NumberFormatException
NumberFormatExceptionpublic short shortValue()
shortValue in class Numberpublic static String toBinaryString(int i)
public static String toHexString(int i)
public static String toOctalString(int i)
public String toString()
public static String toString(int i)
public static String toString(int i, int radix)
public static Integer valueOf(String s) throws NumberFormatException
NumberFormatExceptionpublic static Integer valueOf(String s, int radix) throws NumberFormatException
NumberFormatExceptionpublic static Integer valueOf(int i)
i - the primitivepublic static int signum(int i)
signum function for the specified
integer.i - the integer value to check.i is negative, 1 if i is positive, 0 if
i is zero.public static int compare(int i1,
int i2)
public int compareTo(Integer i)
ComparablecompareTo in interface Comparable<Integer>i - the object to compare to this instance.another;
a positive integer if this instance is greater than
another; 0 if this instance has the same order as
another.public static int numberOfLeadingZeros(int i)