Java List Create createIntArray(List coll)

Here you can find the source of createIntArray(List coll)

Description

Creates an int[] from given coll of Integers.

License

Open Source License

Declaration

public static int[] createIntArray(List<? extends Integer> coll) 

Method Source Code

//package com.java2s;
/*******************************************************************************
 * Copyright (c) 2007 Bruno Medeiros and other Contributors.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:/*  ww w.  j  a v a  2 s.com*/
 *     Bruno Medeiros - initial implementation
 *******************************************************************************/

import java.util.List;

public class Main {
    /** Creates an int[] from given coll of Integers. */
    public static int[] createIntArray(List<? extends Integer> coll) {
        int[] array = new int[coll.size()];
        for (int i = 0; i < coll.size(); i++) {
            array[i] = coll.get(i);
        }
        return array;
    }
}

Related

  1. createGrantScript(List objectsToGrant, String grantee)
  2. createHTMLList(String list, String link, boolean APPEND, String title)
  3. createIfNull(List list)
  4. createIndicesOrderedList(final Collection order, final Collection values)
  5. createInString(List keys)
  6. CreateIntArrayFromIntegerList(List solidsList)
  7. createIntegerList(int[] array)
  8. createIntegerQueryString(List values)
  9. CreateIntegerSequenceList(int startNumber, int endNumber)