Java Utililty Methods List to Int List

List of utility methods to do List to Int List

Description

The list of methods to do List to Int List are organized into topic(s).

Method

StringlistToInString(List list)
list To In String
if (list == null || list.size() == 0)
    return null;
StringBuffer buf = new StringBuffer();
for (int i = 0; i < list.size(); i++) {
    Object obj = list.get(i);
    if (obj != null && obj.toString().length() != 0) {
        if (i != 0)
            buf.append(", ");
...
int[]listToIntArray(final List ints)
list To Int Array
final int[] result = new int[ints.size()];
for (int i = 0; i < result.length; i++) {
    result[i] = ints.get(i);
return result;
int[]listToIntArray(List l)
list To Int Array
int[] foo = new int[l.size()];
int count = 0;
Iterator iter = l.iterator();
while (iter.hasNext()) {
    foo[count++] = ((Integer) iter.next()).intValue();
return foo;
int[]listToIntArray(List list)
Take a list of number objects and return an int[] array
int[] newArray = new int[list.size()];
for (int i = 0; i < list.size(); i++) {
    newArray[i] = list.get(i).intValue();
return newArray;
Integer[][][]listToIntegerArray(List list)
list To Integer Array
Integer[][][] str = new Integer[list.size()][][];
ArrayList a, b;
for (int i = 0; i < list.size(); i++) {
    a = (ArrayList) list.get(i);
    str[i] = new Integer[a.size()][];
    for (int m = 0; m < a.size(); m++) {
        b = (ArrayList) a.get(m);
        str[i][m] = new Integer[b.size()];
...
int[]toIntArray(final List numbers)
to Int Array
final int[] ints = new int[numbers.size()];
for (int i = 0; i < ints.length; i++) {
    final Number number = numbers.get(i);
    ints[i] = number.intValue();
return ints;
int[]toIntArray(final List list)
to Int Array
return toIntArray(list, -1);
int[]toIntArray(final List list)
to Int Array
int[] array = new int[list.size()];
for (int i = 0; i < list.size(); i++) {
    array[i] = list.get(i);
return array;
int[]toIntArray(final List list)
Convert integer list to array.
int[] ret = new int[list.size()];
int pos = 0;
for (Integer it : list) {
    ret[pos] = it.intValue();
    ++pos;
return ret;
int[]toIntArray(java.util.List list)
to Int Array
int[] ret = new int[list.size()];
int i = 0;
for (Integer e : list)
    ret[i++] = e.intValue();
return ret;