Java List Clone clone(List> doc)

Here you can find the source of clone(List> doc)

Description

clone

License

Open Source License

Declaration

public static List<List<String>> clone(List<List<String>> doc) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.util.ArrayList;

import java.util.List;

public class Main {
    public static List<List<String>> clone(List<List<String>> doc) {
        List<List<String>> docClone = new ArrayList<List<String>>();
        for (List<String> tokens : doc) {
            List<String> tokensClone = new ArrayList<String>();
            for (String token : tokens) {
                tokensClone.add(token);//www.  jav  a  2s  .c  om
            }
            docClone.add(tokensClone);
        }
        return docClone;
    }
}

Related

  1. clone(final List list)
  2. clone(List in)
  3. clone(List list)
  4. clone(List list)
  5. clone(List input)
  6. cloneAdd(final List list, final E... element)

  7. HOME | Copyright © www.java2s.com 2016