Here you can find the source of objectToDouble(Object obj)
public static double objectToDouble(Object obj)
//package com.java2s; //License from project: Open Source License public class Main { public static double objectToDouble(Object obj) { if (obj instanceof Integer) { Integer intObj = (Integer) obj; return intObj.doubleValue(); } else if (obj instanceof Double) { Double doubleObj = (Double) obj; return doubleObj; }/* w w w . j ava 2s. c o m*/ return 0; } }