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<Float> list) 

Method Source Code

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

import java.util.List;

public class Main {
    public static float[] toFloatArray(List<Float> list) {
        try {//from  w  w w.  ja  v  a  2s  .  c  om
            float[] ret = new float[list.size()];

            for (int i = 0; i < ret.length; i++) {
                ret[i] = list.get(i).floatValue();
            }

            return ret;
        } catch (NullPointerException e) {
            return null;
        }
    }
}

Related

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