Java List Clone cloneList(List aList)

Here you can find the source of cloneList(List aList)

Description

clone List

License

Open Source License

Declaration

private static List cloneList(List aList) 

Method Source Code

//package com.java2s;
/*//www .  j a v  a2 s . c  om
 TOD - Trace Oriented Debugger.
 Copyright (c) 2006-2008, Guillaume Pothier
 All rights reserved.

 This program is free software; you can redistribute it and/or 
 modify it under the terms of the GNU General Public License 
 version 2 as published by the Free Software Foundation.

 This program is distributed in the hope that it will be useful, 
 but WITHOUT ANY WARRANTY; without even the implied warranty of 
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 
 General Public License for more details.

 You should have received a copy of the GNU General Public License 
 along with this program; if not, write to the Free Software 
 Foundation, Inc., 59 Temple Place, Suite 330, Boston, 
 MA 02111-1307 USA

 Parts of this work rely on the MD5 algorithm "derived from the 
 RSA Data Security, Inc. MD5 Message-Digest Algorithm".
 */

import java.util.ArrayList;

import java.util.List;

public class Main {
    private static List cloneList(List aList) {
        if (aList == null)
            return null;
        if (aList instanceof ArrayList) {
            ArrayList theList = (ArrayList) aList;
            return (List) theList.clone();
        } else
            throw new IllegalArgumentException();
    }
}

Related

  1. clone(List list)
  2. clone(List input)
  3. cloneAdd(final List list, final E... element)
  4. CloneList(final Collection list)
  5. cloneList(final List l, final int n)
  6. cloneList(List l)
  7. cloneList(List sOriginal)
  8. cloneList(List xData)
  9. cloneList(List curList)