List of utility methods to do ArrayList Create
ArrayList | newArrayOfEmptyArrayList(int len) Create an array of len empty ArrayLists.
ArrayList[] result = new ArrayList[len]; for (int i = 0; i < len; i++) { result[i] = new ArrayList<>(); return result; |
ArrayList | sizedArrayList(final int size) Returns a sized array list of type T . return new ArrayList<T>(size); |
List | sizedArrayList(int capacity) sized Array List return new ArrayList<>(capacity); |
ArrayList | stringToArrayList(String s, String sep) string To Array List String[] stringArray = s.split(sep); ArrayList<String> stringList = new ArrayList<String>(); for (String string : stringArray) { stringList.add(string); return stringList; |
ArrayList | stringToArrayList(String string) Convert a String with values separates by comma to ArrayList ArrayList<String> arrayList = new ArrayList<String>(); if (string != null && string.length() > 0) { String[] tabValeur = string.split(","); for (int i = 0; i < tabValeur.length; i++) { arrayList.add(tabValeur[i].trim()); return arrayList; ... |
ArrayList | toArrayList(int[] intValues) to Array List if (intValues == null) { return new ArrayList<Integer>(); ArrayList<Integer> values = new ArrayList<Integer>(intValues.length); for (int i = 0; i < intValues.length; i++) { values.add(new Integer(intValues[i])); return values; ... |
ArrayList | toArrayList(Iterator ii, int initial_capacity) to Array List ArrayList out = new ArrayList(initial_capacity); while (ii.hasNext()) out.add(ii.next()); return out; |
List | toArrayList(String[] stringArray) Creates a new ArrayList , containing the elements of a supplied array of String objects.
List<String> strings = new ArrayList<>(); if (null == stringArray) { return strings; Collections.addAll(strings, stringArray); return strings; |