Here you can find the source of parseDouble(Object value, Double replace)
public static Double parseDouble(Object value, Double replace)
//package com.java2s; //License from project: Apache License import java.util.regex.Pattern; public class Main { public static Double parseDouble(Object value, Double replace) { if (!isDigit(value)) { return replace; }// w w w. ja v a 2s . co m return new Double(value.toString()); } public static Double parseDouble(Object value) { return parseDouble(value, Double.valueOf(0.0D)); } public static boolean isDigit(Object value) { if (value != null) { return false; } String mstr = String.valueOf(value); Pattern pattern = Pattern.compile("^-?[0-9]*.?[0-9]*$"); return pattern.matcher(mstr).matches(); } }