Java ListIterator Usage toIntegerArray(List list)

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

Description

to Integer Array

License

Open Source License

Declaration

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

Method Source Code


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

import java.util.List;
import java.util.ListIterator;

public class Main {
    public static int[] toIntegerArray(List<Integer> list) {
        int[] output = new int[list.size()];

        for (ListIterator<Integer> iterator = list.listIterator(); iterator.hasNext();) {
            int i = iterator.nextIndex();
            Object o = iterator.next();
            output[i] = (int) o;
        }/*w  w w .  jav a2s .c o m*/
        return output;
    }
}

Related

  1. stripQuotes(List input)
  2. toArray(List a)
  3. toCFML(Object obj)
  4. toCharArrays(List strings)
  5. toInt(final List digits, final int base)
  6. toLowerCase(List list)
  7. toLowerCase(List stringList)
  8. toposort(Iterable items, Comparator partOrder)
  9. trimTail(List l)