Java List to Primitive Array toPrimitiveArray(List input)

Here you can find the source of toPrimitiveArray(List input)

Description

toPrimitiveArray

License

Open Source License

Parameter

Parameter Description
input a parameter

Declaration

public static double[] toPrimitiveArray(List<Double> input) 

Method Source Code


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

import java.util.List;

public class Main {
    /**//from   w  ww . ja va2  s .  c  o  m
     * toPrimitiveArray
     * 
     * @param input
     * @return 
     */
    public static double[] toPrimitiveArray(List<Double> input) {
        // create array
        double[] output = new double[input.size()];

        // copy values
        for (int i = 0; i < input.size(); i++) {
            output[i] = input.get(i);
        }

        // return output
        return output;
    }
}

Related

  1. toPrimitiveArray(List array)
  2. toPrimitiveArray(List list)
  3. toPrimitiveArray(List target_)
  4. toPrimitivebyList(List list)
  5. toPrimitiveDouble(List values)