Java Double Number From toDoubleValue(Object value)

Here you can find the source of toDoubleValue(Object value)

Description

to Double Value

License

Open Source License

Declaration

public static Double toDoubleValue(Object value) 

Method Source Code

//package com.java2s;
// The MIT License (MIT)

public class Main {
    public static Double toDoubleValue(Object value) {
        if ((value == null) || (value.getClass() == Double.class)) {
            return (Double) value;
        }//from ww  w  .  j ava 2  s  . co m
        if (value instanceof Number) {
            return ((Number) value).doubleValue();
        }
        throw new IllegalArgumentException(
                "value must be instance of Number.");
    }
}

Related

  1. toDoubles(int[][] intPts)
  2. toDoubles(Object[] extraArgs)
  3. toDoubleScore(Float score)
  4. toDoubleString(Double d)
  5. toDoubleValue(Object number)