Java List Clone cloneMerchantList(List merchantIDs)

Here you can find the source of cloneMerchantList(List merchantIDs)

Description

Clone the merchant ID list

License

Open Source License

Parameter

Parameter Description
merchantIDs - the original merchant id list

Return

- cloned merchant id list

Declaration

public static List cloneMerchantList(List merchantIDs) 

Method Source Code

//package com.java2s;
/**/*from  w  w  w.  j a  v a2s  . co m*/
 * Copyright 2003, 2004  ONCE Corporation
 *
 * LICENSE:
 * This file is part of BuilditMPI. It may be redistributed and/or modified
 * under the terms of the Common Public License, version 1.0.
 * You should have received a copy of the Common Public License along with this
 * software. See LICENSE.txt for details. Otherwise, you may find it online at:
 *   http://www.oncecorp.com/CPL10/ or http://opensource.org/licenses/cpl.php
 *
 * DISCLAIMER OF WARRANTIES AND LIABILITY:
 * THE SOFTWARE IS PROVIDED "AS IS".  THE AUTHOR MAKES NO REPRESENTATIONS OR
 * WARRANTIES, EITHER EXPRESS OR IMPLIED.  TO THE EXTENT NOT PROHIBITED BY LAW,
 * IN NO EVENT WILL THE AUTHOR BE LIABLE FOR ANY DAMAGES, INCLUDING WITHOUT
 * LIMITATION, LOST REVENUE, PROFITS OR DATA, OR FOR SPECIAL, INDIRECT,
 * CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS
 * OF THE THEORY OF LIABILITY, ARISING OUT OF OR RELATED TO ANY FURNISHING,
 * PRACTICING, MODIFYING OR ANY USE OF THE SOFTWARE, EVEN IF THE AUTHOR HAVE
 * BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
 *
 * -----------------------------------------------------
 * $Id$
 */

import java.util.List;
import java.util.Iterator;

import java.util.Collections;
import java.util.ArrayList;

public class Main {
    /**
     * Clone the merchant ID list
     * @param merchantIDs - the original merchant id list
     * @return - cloned merchant id list
     */
    public static List cloneMerchantList(List merchantIDs) {
        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;
    }
}

Related

  1. cloneList(List xData)
  2. cloneList(List curList)
  3. cloneList(List l)
  4. cloneListExcludingAttribute(String attribute, List attributes)
  5. cloneListOfStrings(List list)
  6. cloneProbabilities( List targetProbs)
  7. cloneStringList(List list)
  8. cloneStringList(List list)
  9. cloneStringList(List toClone)