List of utility methods to do List Clone
List | clone(final List Clone a list, not its content List<E> newInstance; try { newInstance = list.getClass().newInstance(); } catch (InstantiationException | IllegalAccessException e) { newInstance = new ArrayList<>(); newInstance.addAll(list); return newInstance; ... |
List | clone(List clone ArrayList<E> out = new ArrayList<E>(in.size()); out.addAll(in); return out; |
List
| clone(List
clone List<List<String>> docClone = new ArrayList<List<String>>(); for (List<String> tokens : doc) { List<String> tokensClone = new ArrayList<String>(); for (String token : tokens) { tokensClone.add(token); docClone.add(tokensClone); return docClone; |
List | clone(List clone List<Object> copy = new ArrayList<Object>(list.size()); for (Object o : list) copy.add(o); return copy; |
List | clone(List clone if (list == null) { return null; List<String> newList = new ArrayList<String>(); for (int i = 0, k = list.size(); i < k; i++) { newList.add(list.get(i)); return newList; ... |
List | clone(List clone if (input == null) { return null; List<T> copy = new ArrayList<T>(); for (T object : input) { copy.add(object); return copy; ... |
List | cloneAdd(final List Clone a list and add N element to it. final List<E> retList = clone(list); Collections.addAll(retList, element); return retList; |
List | CloneList(final Collection list) Clone List return new ArrayList(list); |
List | cloneList(final List Creates a list containing the specified list N times in a row. if (l == null) { throw new IllegalArgumentException("The list to be cloned must not be null."); if (n < 0) { throw new IllegalArgumentException("When cloning a list, N must be non-negative (" + n + ")"); if (n == 0 || isEmpty(l)) { return Collections.emptyList(); ... |
List | cloneList(List aList) clone List if (aList == null) return null; if (aList instanceof ArrayList) { ArrayList theList = (ArrayList) aList; return (List) theList.clone(); } else throw new IllegalArgumentException(); |