Overview | Methods | This Package | All Packages
Converts an object to an integer value.
Syntax
public static int toInt( Object value )
Parameters
value
The value to convert.
Return Value
Returns an integer value that represents the object.
Exceptions
ClassCastException thrown if the argument cannot be converted.
Remarks
The following table lists the supported argument types and the resulting conversion.
Type | Conversion |
null | Returns 0. |
Character | Returns the character stored in the object. Produced by calling Character.charValue. |
Number | Returns the integer value of the object. Produced by calling Number.intValue. |
String | Returns the result of converting the numeric string to an integer value. Produced by calling Integer.parseInt. |
Variant | Returns the result of coercing the variant to an integer value. Produced by calling Variant.toInt. |
See Also toObject