Here you can find the source of toDouble(Object o)
public static double toDouble(Object o)
//package com.java2s; //License from project: Apache License public class Main { public static double toDouble(Object o) { if (o instanceof Double) return (Double) o; if (o instanceof Integer) return (double) ((Integer) o); throw new RuntimeException("Can't convert to double: " + o); }/* w w w. j av a 2 s. co m*/ }