Java List Copy copyIntArray(List li)

Here you can find the source of copyIntArray(List li)

Description

copy Int Array

License

Open Source License

Parameter

Parameter Description
li a parameter

Return

deep copy.

Declaration

public final static List<int[]> copyIntArray(List<int[]> li) 

Method Source Code

//package com.java2s;

import java.util.ArrayList;

import java.util.List;

public class Main {
    /**// w  ww.j  av a2 s .c  o m
     * 
     * @param li
     * @return deep copy.
     */
    public final static List<int[]> copyIntArray(List<int[]> li) {

        List<int[]> liC = new ArrayList<int[]>(li.size());

        for (int[] a : li) {
            int[] c = new int[a.length];
            System.arraycopy(a, 0, c, 0, a.length);
            liC.add(c);
        }

        return liC;
    }
}

Related

  1. copyAndClearList(List sourceList)
  2. copyAndRemove(final List in, final String remove)
  3. copyAndSet(final Map> in, final String key, final String value)
  4. copyArrayToList(Object[] input, List output)
  5. copyFirst(List list, int count)
  6. copyInto(List source, List dest)
  7. copyList(Collection c)
  8. copyList(Collection list)
  9. copyList(final List source, final List destination)