Java List to Float Array toFloatArray(List list)

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

Description

to Float Array

License

Open Source License

Declaration

public static float[] toFloatArray(List<Double> list) 

Method Source Code

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

import java.util.Iterator;
import java.util.List;

public class Main {
    public static float[] toFloatArray(List<Double> list) {
        float[] array = new float[list.size()];
        Iterator<Double> ints = list.iterator();
        int idx = 0;
        while (ints.hasNext()) {
            Double value = ints.next();
            array[idx++] = value.floatValue();
        }//from  w  w w . j  a  v  a 2  s.c o  m
        return array;
    }
}

Related

  1. toFloatArray(Float[] list)
  2. toFloatArray(java.util.List list, float[] res)
  3. toFloatArray(List list)
  4. toFloatArray(List list)
  5. toFloatArray(List list)
  6. toFloatArray(List list)