Java List Flatten flatten(List>... deeps)

Here you can find the source of flatten(List>... deeps)

Description

flatten

License

Open Source License

Declaration

@SafeVarargs
    public static <T> List<T> flatten(List<List<T>>... deeps) 

Method Source Code


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

import java.util.*;

public class Main {
    @SafeVarargs
    public static <T> List<T> flatten(List<List<T>>... deeps) {
        List<T> result = new LinkedList<>();
        for (List<List<T>> deep : deeps) {
            for (List<T> list : deep) {
                result.addAll(list);/*w  w  w.  ja  v  a 2  s  .c om*/
            }
        }
        return result;
    }
}

Related

  1. flatten(List> list)
  2. flatten(List input)
  3. flatten(List list, List flat)
  4. flatten(List> nested)
  5. flatten(List l)
  6. flattenList(List> listOfLists)

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