List of utility methods to do List from Array
ArrayList | asList(T[] array) Given an input array, will return an ArrayList representation of the array. if (array == null) { return null; ArrayList<T> list = new ArrayList<T>(array.length); for (T e : array) { list.add(e); return list; ... |
List | asList(T[] array) as List List<T> list; if (array != null) { list = Arrays.asList(array); } else { list = Collections.emptyList(); return list; |
List | asList(T[] array) Converts an array to a List This method is similar to Arrays.asList, except that it returns a writeable list if (array == null) { return new ArrayList<T>(); List<T> result = new ArrayList<T>(array.length); for (T t : array) { result.add(t); return result; ... |
List | asList(T[] array) as List List<T> list = new ArrayList<T>(); for (T t : array) { list.add(t); return list; |
List | asList(T[] array) as List ArrayList<T> list = new ArrayList<T>(); Collections.addAll(list, array); return list; |
List | asListFromObjectArray(Object[] at) as List From Object Array final List<T> result = new ArrayList<T>(at.length); for (Object t : at) { result.add((T) t); assert result.size() == at.length; return result; |
List | convertArrayToList(int[] ids) convert Array To List int i; List result = null; if (ids != null) { result = new ArrayList(); for (i = 0; i < ids.length; ++i) result.add(new Integer(ids[i])); return result; ... |
List | convertArrayToList(List convert Array To List if (null == strs) { return new ArrayList<String>(50); if (null == list) { list = new ArrayList<String>(50); list.addAll(Arrays.asList(strs)); return list; ... |
List | convertArrayToList(Object value) convert Array To List List list = new ArrayList(); if (value instanceof int[]) { int[] arr = (int[]) value; for (int ix = 0; ix < arr.length; ix++) { list.add(arr[ix]); } else if (value instanceof double[]) { double[] arr = (double[]) value; ... |
List | convertArrayToList(Object[] objects) convert Array To List List rtnList = new ArrayList(); for (int i = 0; i < objects.length; i++) { rtnList.add(objects[i]); return rtnList; |