Java List Flatten flattenList(List> listOfLists)

Here you can find the source of flattenList(List> listOfLists)

Description

flatten List

License

Apache License

Declaration

public static <T> List<T> flattenList(List<List<T>> listOfLists) 

Method Source Code


//package com.java2s;
//    Licensed under the Apache License, Version 2.0 (the "License");

import java.util.ArrayList;
import java.util.List;

public class Main {
    public static <T> List<T> flattenList(List<List<T>> listOfLists) {
        List<T> flatList = new ArrayList<T>();
        listOfLists.forEach(flatList::addAll);
        return flatList;
    }//  ww w . j av a 2  s. c o  m
}

Related

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

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