Java List to Double Array toDoubleArray(List a)

Here you can find the source of toDoubleArray(List a)

Description

to Double Array

License

Apache License

Declaration

public static double[] toDoubleArray(List<? extends Number> a) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.util.*;

public class Main {
    public static double[] toDoubleArray(List<? extends Number> a) {
        double[] d = new double[a.size()];
        for (int i = 0; i < d.length; ++i) {
            d[i] = a.get(i).doubleValue();
        }/*  w w  w  . ja  v  a  2  s .  co  m*/
        return d;
    }

    public static <T extends Number, R> T get(Map<R, T> map, R key, T defaultValue) {
        T val = map.get(key);
        return val == null ? defaultValue : val;
    }
}

Related

  1. toDoubleArray(final List numbers)
  2. toDoubleArray(final List list)
  3. toDoubleArray(List list)
  4. toDoubleArray(List list)
  5. toDoubleArray(List list)
  6. toDoubleArray(List list)