Java List to Int List toIntArray(List ints)

Here you can find the source of toIntArray(List ints)

Description

to Int Array

License

Open Source License

Declaration

public static int[] toIntArray(List<? extends Number> ints) 

Method Source Code

//package com.java2s;
/**/*from ww w. j a v  a2s  .c o m*/
 * Copyright (c) 2011 Michael Kutschke. 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:
 * Michael Kutschke - initial API and implementation.
 */

import java.util.List;

public class Main {
    public static int[] toIntArray(List<? extends Number> ints) {
        int[] result = new int[ints.size()];
        int i = 0;
        for (Number j : ints) {
            result[i] = j.intValue();
            i++;
        }
        return result;
    }
}

Related

  1. toIntArray(final List list)
  2. toIntArray(final List list)
  3. toIntArray(java.util.List list)
  4. toIntArray(List list)
  5. toIntArray(List nums)
  6. toIntArray(List bytes)
  7. toIntArray(List a)
  8. toIntArray(List integerList)
  9. toIntArray(List intList)