toPrimitiveDouble()

Converts an object or primitive data type to the primitive double data type.

Syntax

double toPrimitiveDouble(Object objectData)
 double toPrimitiveDouble(int integerData)
 double toPrimitiveDouble(float floatData)
 

Parameters

objectData
A Java object. The objects currently supported are: Double, Float, Integer, and String.
integerData
Any primitive int variable.
floatData
Any primitive float variable.

Return values

Returns a primitive double value.

Exceptions

DtpIncompatibleFormatException - If the source data type cannot be converted to double.

Examples

double myDouble = DtpDataConversion.toPrimitiveDouble(myObject);
 

See also

getType(), isOKToConvert(), toDouble()

Copyright IBM Corp. 2003