Java List to Float Array toFloatArray(Float[] list)

Here you can find the source of toFloatArray(Float[] list)

Description

to Float Array

License

Open Source License

Declaration

public static float[] toFloatArray(Float[] list) 

Method Source Code

//package com.java2s;
/*/*from   w  w  w  .j a  va  2 s .  c  o m*/
Weave (Web-based Analysis and Visualization Environment)
Copyright (C) 2008-2011 University of Massachusetts Lowell
    
This file is a part of Weave.
    
Weave is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License, Version 3,
as published by the Free Software Foundation.
    
Weave is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.
    
You should have received a copy of the GNU General Public License
along with Weave.  If not, see <http://www.gnu.org/licenses/>.
*/

import java.util.List;

public class Main {
    public static float[] toFloatArray(Float[] list) {
        float[] array = new float[list.length];
        for (int i = 0; i < array.length; i++)
            array[i] = list[0];
        return array;
    }

    public static float[] toFloatArray(List<Float> list) {
        float[] array = new float[list.size()];
        for (int i = 0; i < array.length; i++)
            array[i] = list.get(i);
        return array;
    }
}

Related

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