Java List to Double Array toDoubleArray(List values)

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

Description

Creates an array of type double[] from a list of instances of class Double.

License

Open Source License

Parameter

Parameter Description
values the list of instances of class Double

Return

the array of type double[] containing the values from the given list

Declaration

public static double[] toDoubleArray(List<Double> values) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.util.*;

public class Main {
    /**//w w  w .  j  a  va2  s.  co m
     * Creates an array of type double[] from a list of instances of class Double.
     * @param values the list of instances of class Double
     * @return the array of type double[] containing the values from the given list
     */
    public static double[] toDoubleArray(List<Double> values) {
        double ret[] = new double[values.size()];
        for (int i = 0; i < ret.length; i++)
            ret[i] = values.get(i);
        return ret;
    }
}

Related

  1. toDoubleArray(List list)
  2. toDoubleArray(List list)
  3. toDoubleArray(List list)
  4. toDoubleArray(List list)
  5. toDoubleArray(List list)
  6. toDoubleArray(List stringArray)
  7. toDoubleArray(List values)
  8. toDoubleList(double[] array)
  9. toDoubleList(double[] array)