Java Collection to Array convertToArray(Collection input)

Here you can find the source of convertToArray(Collection input)

Description

convert To Array

License

Open Source License

Declaration

public static double[] convertToArray(Collection<Double> input) 

Method Source Code


//package com.java2s;

import java.util.Collection;

public class Main {
    public static double[] convertToArray(Collection<Double> input) {
        double[] result = new double[input.size()];
        int count = 0;
        for (double d : input) {
            result[count++] = d;/* w w  w. ja  va2  s . co m*/
        }

        return result;
    }
}

Related

  1. collectionToIntArray(Collection c)
  2. collectionToIntArray(final Collection numbers)
  3. collectionToObjectArray(Collection c)
  4. collectionToObjectArray(final Collection _list)
  5. convertToArray(Collection collection)
  6. convertToArray(Collection items)
  7. toArray(Collection c)
  8. toArray(Collection coll)
  9. toArray(Collection bytes)