Java List Clone cloneStringList(List toClone)

Here you can find the source of cloneStringList(List toClone)

Description

Method to clone a specific list.

License

Open Source License

Parameter

Parameter Description
toClone The list to clone.

Return

A completly cloned list.

Declaration

public static List<String> cloneStringList(List<String> toClone) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.util.ArrayList;

import java.util.List;

public class Main {
    /**/*from  w w  w. j a v a  2  s  . co  m*/
     * Method to clone a specific list. A list of Strings.
     * 
     * @param toClone
     *            The list to clone.
     * @return A completly cloned list.
     */
    public static List<String> cloneStringList(List<String> toClone) {
        List<String> result = new ArrayList<String>();

        for (String s : toClone) {
            result.add(new String(s));
        }

        return result;
    }
}

Related

  1. cloneListOfStrings(List list)
  2. cloneMerchantList(List merchantIDs)
  3. cloneProbabilities( List targetProbs)
  4. cloneStringList(List list)
  5. cloneStringList(List list)
  6. cloneToList(final Collection list)
  7. getClone(List> lls)
  8. getClonedSublistOf(List list, int startIndexInclusive, int endIndexExclusive)