public Double getAsDouble(String key) {
        Object value = mValues.get(key);
        try {
            return value != null ? ((Number) value).doubleValue() : null;
        } catch (ClassCastException e) {
            if (value instanceof CharSequence) {
                try {
                    return Double.valueOf(value.toString());
                } catch (NumberFormatException e2) {
                    logger.severe("Cannot parse Double value for " + value + " at key " + key);
                    return null;
                }
            } else {
                logger.log(Level.SEVERE, "Cannot cast value for " + key + " to a Double: " + value, e);
                return null;
            }
        }
    }
public Double getAsDouble ( String key ) { Object value = mValues . get ( key ) ; try { return value != null ? ( ( Number ) value ) . doubleValue ( ) : null ; } catch ( ClassCastException e ) { if ( value instanceof CharSequence ) { try { return Double . valueOf ( value . toString ( ) ) ; } catch ( NumberFormatException e2 ) { logger . severe ( "Cannot parse Double value for " + value + " at key " + key ) ; return null ; } } else { logger . log ( Level . SEVERE , "Cannot cast value for " + key + " to a Double: " + value , e ) ; return null ; } } }
Gets a value and converts it to a Double.

@param key the value to get
@return the Double value, or null if the value is missing or cannot be converted