Here you can find the source of asDouble(Object value)
public static double asDouble(Object value)
//package com.java2s; //License from project: Open Source License public class Main { public static double asDouble(Object value) { if (value instanceof Double) { return ((Double) value).doubleValue(); }//from w ww .j a va2 s.co m throw new IllegalArgumentException("not a number"); } public static double asDouble(Object value, double def) { if (value instanceof Double) { return ((Double) value).doubleValue(); } return def; } }