List of utility methods to do Array to ArrayList
List | toArrayList(Object pObject) to Array List List array; if (pObject == null) { array = new ArrayList(1); else if (pObject instanceof String) { array = new ArrayList(1); array.add(pObject); else { String[] lObjectArray = (String[]) pObject; array = new ArrayList(lObjectArray.length); for (int i = 0; i < lObjectArray.length; i++) { array.add(lObjectArray[i]); return array; |
ArrayList | toArrayList(String str) Parses a formated string and returns an array. int[] tmp = toArray(str); ArrayList<Integer> list = new ArrayList<Integer>(); for (int i = 0; i < tmp.length; i++) { list.add(tmp[i]); return list; |
List | toArrayList(String[] ss) to Array List List<String> list = new ArrayList<String>(); for (String s : ss) list.add(s); return list; |
List | toArrayList(T... items) to Array List List<T> list = new ArrayList<>(items.length); for (T item : items) list.add(item); return list; |
List | toArrayList(T[] vals) to Array List List<T> list = new ArrayList<T>(); for (T val : vals) { list.add(val); return list; |
ArrayList[] | toArrayListArr(ArrayList al) to Array List Arr return (ArrayList[]) al.toArray(arrayListArr);
|
List | toByteArrayList(byte[] list) to Byte Array List List<Byte> ret = new ArrayList<>(); for (byte b : list) { ret.add(b); return ret; |