List of utility methods to do List Copy
List | copyFirst(List Copies count items off of list, starting from the beginning.
List<T> ret = new ArrayList<T>(list.size() < count ? list.size() : count); int i = 0; for (T elem : list) { ret.add(elem); if (i++ > count) { break; return ret; |
List | copyIntArray(List copy Int Array List<int[]> liC = new ArrayList<int[]>(li.size()); for (int[] a : li) { int[] c = new int[a.length]; System.arraycopy(a, 0, c, 0, a.length); liC.add(c); return liC; |
void | copyInto(List copy Into dest.clear();
for (T obj : source)
dest.add(obj);
|
List | copyList(Collection copy List if (c == null || c.size() == 0) { return new ArrayList<T>(0); } else { return new ArrayList<T>(c); |
List | copyList(Collection copy List List<T> result = new ArrayList<>(); for (T el : list) result.add(el); return result; |
void | copyList(final List source, final List destination) Copy the contents of the source list to the destination list Any items in the destination list before the copy will be removed if (source != null && destination != null) { destination.clear(); for (Object obj : source) { destination.add(obj); |
List | copyList(final List Return a simple "copy" of the list of objects without cloning each object instance if (list != null) { final List<K> newList = new ArrayList<K>(list.size()); for (K o : list) { newList.add(o); return newList; return null; ... |
List | copyList(List objects) Copies a List into a new List. if (objects == null) { return null; List newList = new ArrayList(objects.size()); for (Object o : objects) { newList.add(o); return newList; ... |
void | copyList(List source, List destination) copy List destination.clear();
for (Object o : source) {
destination.add(o);
|
List | copyList(List src) Copy specified list to a new list List lstResult = new ArrayList(); if (src != null) { for (Iterator it = src.iterator(); it.hasNext();) { lstResult.add(it.next()); return lstResult; |