List of utility methods to do ArrayList Create
ArrayList | newArrayList(Iterable new Array List if (iterable == null) { throw new NullPointerException(); ArrayList<E> list = new ArrayList<E>(); for (Iterator<E> i = iterable.iterator(); i.hasNext();) { list.add(i.next()); return list; ... |
List | newArrayList(T anObj) Creates a new array list with given object. return newArrayList(10, anObj);
|
List | newArrayList(T... elements) Avoid dependency on Guava types List<T> list = new ArrayList<>(1); Collections.addAll(list, elements); return list; |
List | newArrayList(T... items) new Array List List<T> list = new ArrayList<T>(); for (T t : items) { list.add(t); return list; |
List | newArrayList(T... objectList) new Array List List<T> list = new ArrayList<T>(objectList.length); for (T obj : objectList) { list.add(obj); return list; |
List | newArrayList(T... objs) Returns the value mapped by key, or if no mapping exists, puts to map and returns the value supplied by valueSupplier. List<T> results = new ArrayList<T>(); results.addAll(Arrays.asList(objs)); return results; |
List | newArrayList(X... args) new Array List return Arrays.asList(args);
|
List | newArrayListOnNull(List new Array List On Null if (list == null) { list = new ArrayList<T>(); return list; |
ArrayList | newArrayListSized(Iterable> fromSize) Creates a new ArrayList which if possible is sized the same as the passed in iterable (ie only if it is actually a Collection). if (fromSize instanceof Collection<?>) return new ArrayList<T>(((Collection<?>) fromSize).size()); else return new ArrayList<T>(); |
ArrayList | newArrayListWithCapacity(int initSize) new Array List With Capacity return new ArrayList<T>(initSize); |