List of utility methods to do List to Array
String[] | listToArray(List list) list To Array final int size = list.size(); String[] str = (String[]) list.toArray(new String[size]); return str; |
Object[] | listToArray(List> list) list To Array if (list == null) { return new Object[] {}; Object[] arr = new Object[list.size()]; return list.toArray(arr); |
Object[] | listToArray(List> list) Convert List if (list == null) { return null; } else { Object valueArr[] = new Object[list.size()]; list.toArray(valueArr); return valueArr; |
byte[] | listToArray(List list To Array byte[] buffer; buffer = new byte[bytes.size()]; int i = 0; for (Byte b : bytes) { buffer[i++] = b; return buffer; |
Comparable[] | listToArray(List list To Array Comparable[] array = new Comparable[list.size()]; int i = 0; for (Comparable c : list) { array[i] = c; i++; return array; |
double[] | listToArray(List Convert a list of Doubles to an array of primitive double types. double[] array = new double[doubles.size()]; for (int i = 0; i < doubles.size(); i++) { array[i] = doubles.get(i); return array; |
double[] | listToArray(List list To Array double[] arr = new double[list.size()]; for (int i = 0; i < list.size(); ++i) arr[i] = list.get(i); return arr; |
float[] | listToArray(List list To Array int size = list != null ? list.size() : 0; float[] floatArr = new float[size]; for (int i = 0; i < size; i++) { floatArr[i] = list.get(i); return floatArr; |
int[] | ListToArray(List Convert a List of Integer s to an array of int s.
if (list == null) { return null; int count = list.size(); int[] result = new int[count]; for (int i = 0; i < count; ++i) { result[i] = list.get(i); return result; |
int[] | listToArray(List list To Array if (isEmpty(list)) { return null; int[] result = new int[list.size()]; for (int i = 0; i < result.length; i++) { result[i] = list.get(i); return result; ... |