public double getDoubleValue(int index) {
        Object value = get(index);

        if (value == null) {
            return 0D;
        }

        if (value instanceof Number) {
            return ((Number) value).doubleValue();
        }

        if (value instanceof String) {
            String str = (String) value;

            if (str.isEmpty() || "null".equalsIgnoreCase(str)) {
                return 0D;
            }

            return Double.parseDouble(str);
        }

        throw new JSONException("Can not cast '" + value.getClass() + "' to double value");
    }
Returns a double value at the specified location in this {@link JSONArray}.

@param index index of the element to return
@return double
@throws NumberFormatException If the value of get is {@link String} and it contains no parsable double
@throws JSONException Unsupported type conversion to double value
@throws IndexOutOfBoundsException if the index is out of range {@code (index < 0 || index >= size())}
core/src/main/java/com/alibaba/fastjson2/JSONArray.java