Here you can find the source of copyList(List src)
Parameter | Description |
---|---|
src | source list |
public static List copyList(List src)
//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; } }