Java Utililty Methods List Clone

List of utility methods to do List Clone

Description

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

Method

ListcloneList(List l)
clone List
ArrayList<Object> list = new ArrayList();
if (l == null)
    return null;
for (Object o : l) {
    list.add(o);
return list;
ListcloneList(List sOriginal)
clone List
if (sOriginal == null) {
    return null;
} else {
    return new ArrayList(sOriginal);
ListcloneList(List xData)
clone List
List<double[]> result = new ArrayList<double[]>();
for (double[] currArr : xData) {
    result.add(currArr.clone());
return result;
ListcloneList(List curList)
clone List
List<T> newList = new ArrayList<T>();
newList.addAll(curList);
return newList;
ListcloneList(List l)
clone List
return new ArrayList<>(l);
ListcloneListExcludingAttribute(String attribute, List attributes)
clone List Excluding Attribute
List<String> clonedList = new ArrayList<>(attributes);
clonedList.remove(attribute);
return clonedList;
ListcloneListOfStrings(List list)
clone a list of string deep into elements
List<String> clone = new ArrayList<String>(list.size());
for (String item : list)
    clone.add(cloneString(item));
return clone;
ListcloneMerchantList(List merchantIDs)
Clone the merchant ID list
if (merchantIDs == null)
    return null;
List lst = Collections.synchronizedList(new ArrayList());
String id;
for (Iterator lt = merchantIDs.iterator(); lt.hasNext();) {
    id = (String) lt.next();
    lst.add(new String(id));
return lst;
ArrayListcloneProbabilities(List targetProbs)
clone Probabilities
if (targetProbs != null && !targetProbs.isEmpty()) {
    ArrayList<Integer> copy = new ArrayList<Integer>(targetProbs.size());
    for (int index = 0; index < targetProbs.size(); index++) {
        copy.add(targetProbs.get(index));
    return copy;
} else {
    return null;
...
ListcloneStringList(List list)
clone String List
List<String> copiedList = new ArrayList<String>();
for (String s : list) {
    copiedList.add(s);
return copiedList;