Java List to Int List toIntegerArray(List values)

Here you can find the source of toIntegerArray(List values)

Description

Creates an array of type int[] from a list of instances of class Integer.

License

Open Source License

Parameter

Parameter Description
values the list of instances of class Integer

Return

the array of type int[] containing the values from the given list

Declaration

public static int[] toIntegerArray(List<Integer> values) 

Method Source Code


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

import java.util.*;

public class Main {
    /**// w  w w .j  a  v a2s.c o  m
     * Creates an array of type int[] from a list of instances of class Integer.
     * @param values the list of instances of class Integer
     * @return the array of type int[] containing the values from the given list
     */
    public static int[] toIntegerArray(List<Integer> values) {
        int ret[] = new int[values.size()];
        for (int i = 0; i < ret.length; i++)
            ret[i] = values.get(i);
        return ret;
    }
}

Related

  1. toIntArray(List list)
  2. toIntArray(List values)
  3. toIntArray_impl(List i_list, int i_offset, int i_size)
  4. toIntegerArray(final List list)
  5. toIntegerArray(List arrayValues)
  6. toIntegerList(final E[] array)
  7. toIntegerList(int... array)
  8. toIntegerList(int[] array)
  9. toIntegerList(int[] intArray)