List of utility methods to do List to Int List
int[] | toIntArray(List list) Converts the argument to an int[] array. final int[] array = new int[list.size()]; for (int i = 0; i < array.length; i++) array[i] = ((Integer) list.get(i)).intValue(); return array; |
int[] | toIntArray(List nums) Convert a List of Number objects to an int array.
int[] result = new int[nums.size()]; Iterator iter; int i; for (i = 0, iter = nums.iterator(); iter.hasNext(); i++) { Number num = (Number) iter.next(); result[i] = num.intValue(); return result; ... |
int[] | toIntArray(List extends Number> ints) to Int Array int[] result = new int[ints.size()]; int i = 0; for (Number j : ints) { result[i] = j.intValue(); i++; return result; |
ArrayList | toIntArray(List Coverts a data stream represented as an array of bytes to an array of integers. if (bytes.size() % 4 != 0) { throw new IllegalArgumentException( "Integer Array can only be created from byte arrays where size%4 is 0"); ArrayList<Integer> integers = new ArrayList<Integer>(); for (int index = 0; index < bytes.size(); index += 4) { integers.add( new Integer(((bytes.get(index) << 24) & 0xff000000) | ((bytes.get(index + 1) << 16) & 0xff0000) ... |
int[] | toIntArray(List to Int Array int[] d = new int[a.size()]; for (int i = 0; i < d.length; ++i) { d[i] = a.get(i); return d; |
int[] | toIntArray(List to Int Array if (integerList == null) return null; int[] intArray = new int[integerList.size()]; for (int i = 0; i < integerList.size(); i++) { intArray[i] = integerList.get(i); return intArray; |
int[] | toIntArray(List Convert a List assert intList != null; if (intList == null) { return null; int[] ints = new int[intList.size()]; for (int i = 0; i < intList.size(); i++) { ints[i] = intList.get(i); return ints; |
int[] | toIntArray(List to Int Array int[] array = new int[list.size()]; for (int i = 0; i < array.length; i++) array[i] = list.get(i); return array; |
int[] | toIntArray(List Converts a List with Integer objects to a primary type int array if (list == null) return null; int[] arr = new int[list.size()]; int i = 0; for (Integer v : list) arr[i++] = v; return arr; |
int[] | toIntArray(List to Int Array int[] array = new int[list.size()]; Iterator<Integer> ints = list.iterator(); int idx = 0; while (ints.hasNext()) { Integer value = ints.next(); array[idx++] = value.intValue(); return array; ... |