List of utility methods to do List from Array
Collection | asList(int... data) as List ArrayList<Integer> list = new ArrayList<Integer>(data.length); for (int i : data) list.add(i); return list; |
List | asList(int... values) as List int len = length(values); if (len <= 0) { return Collections.emptyList(); List<Integer> l = new ArrayList<>(len); for (int v : values) { l.add(v); return l; |
List | asList(int[] a) as List List<Integer> result = new ArrayList<Integer>(a.length); for (int i = 0; i < a.length; i++) { result.add(Integer.valueOf(a[i])); return result; |
List | asList(int[] ai) as List final List<Integer> result = new ArrayList<Integer>(ai.length); for (int i : ai) { result.add(i); assert result.size() == ai.length; return result; |
List | asList(int[] ar) as List List<Integer> list = new ArrayList<Integer>(ar.length); for (int a : ar) list.add(a); return list; |
List | asList(int[] arr) as List Integer[] arrObj = new Integer[arr.length]; for (int i = 0; i < arr.length; i++) { arrObj[i] = arr[i]; return Arrays.asList(arrObj); |
List | asList(int[] ints) as List List list = new ArrayList(); for (int i = 0; i < ints.length; i++) { list.add(i, ints[i]); return list; |
List | asList(int[] list) Converts an array of primitives to a list of Integers. if (list == null) { return null; List<Integer> ilist = new ArrayList<Integer>(list.length); for (int ii = 0; ii < list.length; ii++) { ilist.add(list[ii]); return ilist; ... |
ArrayList | asList(int[] values) as List if (values == null) { return null; ArrayList<Integer> list = new ArrayList<Integer>(values.length); for (int i = 0; i < values.length; i++) { list.add(new Integer(values[i])); return list; ... |
List | asList(Iterable extends T> iterable) Returns all elements from the given iterable as a list List<T> list = new ArrayList<T>(); addAll(iterable, list); return list; |