Value.toLong

Overview | Methods | This Package | All Packages

Value.toLong

Converts an object to a long value.

Syntax

public static long toLong( Object value )

Parameters

value

The value to convert.

Return Value

Returns a long 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 long value of the object. Produced by calling Number.longValue.
String Returns the result of converting the numeric string to a long value. Produced by calling Long.parseLong.
Time Returns the long value of the object. Produced by calling Time.toLong.
Variant Returns the result of coercing the variant to a double value and then casting the result to long. Produced by calling Variant.toDouble.

See Also   toObject