Java List Copy copyList(List src)

Here you can find the source of copyList(List src)

Description

Copy specified list to a new list

License

Open Source License

Parameter

Parameter Description
src source list

Return

new list

Declaration

public static List copyList(List src) 

Method Source Code


//package com.java2s;
/*//from  ww  w.  j  a  v  a2  s.  co m
 * File: $RCSfile$
 *
 * Copyright (c) 2005 Wincor Nixdorf International GmbH,
 * Heinz-Nixdorf-Ring 1, 33106 Paderborn, Germany
 * All Rights Reserved.
 *
 * This software is the confidential and proprietary information
 * of Wincor Nixdorf ("Confidential Information"). You shall not
 * disclose such Confidential Information and shall use it only in
 * accordance with the terms of the license agreement you entered
 * into with Wincor Nixdorf.
 */

import java.util.List;

import java.util.Iterator;
import java.util.ArrayList;

public class Main {
    /**
     * Copy specified list to a new list
     *
     * @param src source list
     * @return new list
     */
    public static List copyList(List src) {
        List lstResult = new ArrayList();
        if (src != null) {
            for (Iterator it = src.iterator(); it.hasNext();) {
                lstResult.add(it.next());
            }
        }
        return lstResult;
    }
}

Related

  1. copyList(Collection list)
  2. copyList(final List source, final List destination)
  3. copyList(final List list)
  4. copyList(List objects)
  5. copyList(List source, List destination)
  6. copyList(List list)
  7. copyList(List list)
  8. copyList(List list)
  9. copyList(List list)