Java List Copy copy(List[] sourceLists, List[] destLists)

Here you can find the source of copy(List[] sourceLists, List[] destLists)

Description

copy

License

Open Source License

Parameter

Parameter Description
sourceLists a parameter
destLists a parameter

Declaration

private static void copy(List[] sourceLists, List[] destLists) 

Method Source Code

//package com.java2s;
/*******************************************************************************
 * Copyright (c) 2004 Actuate Corporation.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors://  w ww  .j  a  v a  2s  . c  om
 *  Actuate Corporation  - initial API and implementation
 *******************************************************************************/

import java.util.List;

public class Main {
    /**
     * 
     * @param sourceLists
     * @param destLists
     */
    private static void copy(List[] sourceLists, List[] destLists) {
        for (int i = 0; i < sourceLists.length; i++) {
            destLists[i].clear();
            for (int j = 0; j < sourceLists[i].size(); j++) {
                destLists[i].add(sourceLists[i].get(j));
            }
        }
    }
}

Related

  1. copy(List list)
  2. copy(List list)
  3. copy(List original)
  4. copy(List toCopy)
  5. copy(List toCopy)
  6. copyAndClearList(List sourceList)
  7. copyAndRemove(final List in, final String remove)
  8. copyAndSet(final Map> in, final String key, final String value)
  9. copyArrayToList(Object[] input, List output)