Java Utililty Methods List Copy

List of utility methods to do List Copy

Description

The list of methods to do List Copy are organized into topic(s).

Method

float[]copyToArray(List list, float[] array)
Copies the contents from an array list to an array.
for (int i = 0; i < list.size(); i++) {
    array[i] = list.get(i);
return array;
ListcopyToArrayListWithExtraCapacity(T[] elements, int extraCapacity)
Produces an ArrayList for an array of elements where the list is pre-sized with extra capacity.
List<T> asList;
if (elements != null) {
    asList = new ArrayList<T>(elements.length + extraCapacity);
    asList.addAll(Arrays.asList(elements));
} else {
    asList = new ArrayList<T>(extraCapacity);
return asList;
...
ListcopyToList(Iterable elements)
copy To List
List<E> list = new ArrayList<E>();
addAll(list, elements);
return list;
ListcopyTypes(List src, List dest)
copy Types
if (isEmpty(src)) {
    if (dest != null) {
        dest.clear();
} else {
    if (dest == null) {
        dest = new ArrayList<String>(src.size());
    } else {
...