|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.lang.Number | +--java.lang.Integer
The Integer class is a wrapper for integer values. In Java, integers are not objects and most of the Java utility classes require the use of objects. Thus, if you needed to store an integer in a hashtable, you would have to "wrap" an Integer instance around it.
Field Summary | |
static int |
MAX_VALUE
The maximum value an Integer can have. |
static int |
MIN_VALUE
The minimum value an Integer can have. |
Constructor Summary | |
Integer(int value)
Constructs an Integer object initialized to the specified int value. |
|
Integer(String s)
Constructs an Integer object initialized to the value specified by the String parameter. |
Method Summary | |
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. |
static Integer |
getInteger(String nm)
Gets an Integer property. |
static Integer |
getInteger(String nm,
int val)
Gets an Integer property. |
static Integer |
getInteger(String nm,
Integer val)
Gets an Integer property. |
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 |
parseInt(String s)
Assuming the specified String represents an integer, returns that integer's value. |
static int |
parseInt(String s,
int radix)
Assuming the specified String represents an integer, returns that integer's value. |
static String |
toBinaryString(int i)
Returns a new String object representing the specified integer as unsigned binary number. |
static String |
toHexString(int i)
Returns a new String object representing the specified integer as unsigned hexidecimal number. |
static String |
toOctalString(int i)
Returns a new String object representing the specified integer as unsigned octal number. |
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)
Returns a new String object representing the specified integer in the specified radix. |
static Integer |
valueOf(String s)
Assuming the specified String represents an integer, returns a new Integer object initialized to that value. |
static Integer |
valueOf(String s,
int radix)
Assuming the specified String represents an integer, returns a new Integer object initialized to that value. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int MIN_VALUE
public static final int MAX_VALUE
Constructor Detail |
public Integer(int value)
value
- the initial value of the Integerpublic Integer(String s) throws NumberFormatException
s
- the String to be converted to an Integer
NumberFormatException
- If the String does not contain a parsable
integer.Method Detail |
public static String toString(int i, int radix)
i
- the integer to be convertedradix
- the radixCharacter.MIN_RADIX
,
Character.MAX_RADIX
public static String toHexString(int i)
public static String toOctalString(int i)
public static String toBinaryString(int i)
public static String toString(int i)
i
- the integer to be convertedpublic static int parseInt(String s, int radix) throws NumberFormatException
s
- the String containing the integerradix
- the radix to be used
NumberFormatException
- If the String does not contain a parsable
integer.public static int parseInt(String s) throws NumberFormatException
s
- the String containing the integer
NumberFormatException
- If the string does not contain a parsable
integer.public static Integer valueOf(String s, int radix) throws NumberFormatException
s
- the String containing the integerradix
- the radix to be used
NumberFormatException
- If the String does not contain a parsable
integer.public static Integer valueOf(String s) throws NumberFormatException
s
- the String containing the integer
NumberFormatException
- If the String does not contain a parsable
integer.public int intValue()
intValue
in class Number
public long longValue()
longValue
in class Number
public float floatValue()
floatValue
in class Number
public double doubleValue()
doubleValue
in class Number
public String toString()
toString
in class Object
public int hashCode()
hashCode
in class Object
Hashtable
public boolean equals(Object obj)
equals
in class Object
obj
- the object to compare with
Hashtable
public static Integer getInteger(String nm)
nm
- the property namepublic static Integer getInteger(String nm, int val)
nm
- the String nameval
- the Integer valuepublic static Integer getInteger(String nm, Integer val)
nm
- the property nameval
- the integer value
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |