Java List to Double Array toDoubleArray(List list)

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

Description

to Double Array

License

Open Source License

Declaration

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

Method Source Code


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

import java.util.*;

public class Main {
    public static double[] toDoubleArray(List<Double> list) {
        if (isNullOrEmpty(list)) {
            return null;
        }/*from w  w w  . j  a  v a 2 s . c  om*/
        double[] doubles = new double[list.size()];
        for (int i = 0; i < doubles.length; i++) {
            doubles[i] = list.get(i);
        }
        return doubles;
    }

    public static boolean isNullOrEmpty(Collection c) {
        return c == null || c.isEmpty();
    }

    public static boolean isNullOrEmpty(String s) {
        return s == null || s.isEmpty();
    }
}

Related

  1. toDoubleArray(final List numbers)
  2. toDoubleArray(final List list)
  3. toDoubleArray(List a)
  4. toDoubleArray(List list)
  5. toDoubleArray(List list)
  6. toDoubleArray(List list)
  7. toDoubleArray(List list)
  8. toDoubleArray(List list)
  9. toDoubleArray(List values)