public double optDouble(int index, double defaultValue) {
        final Number val = this.optNumber(index, null);
        if (val == null) {
            return defaultValue;
        }
        final double doubleValue = val.doubleValue();
        // if (Double.isNaN(doubleValue) || Double.isInfinite(doubleValue)) {
        // return defaultValue;
        // }
        return doubleValue;
    }
public double optDouble ( int index , double defaultValue ) { final Number val = this . optNumber ( index , null ) ; if ( val == null ) { return defaultValue ; } final double doubleValue = val . doubleValue ( ) ; return doubleValue ; }
Get the optional double value associated with an index. The defaultValue
is returned if there is no value for the index, or if the value is not a
number and cannot be converted to a number.

@param index
subscript
@param defaultValue
The default value.
@return The value.