Java List Combine combine(List> lists)

Here you can find the source of combine(List> lists)

Description

Combines a bunch of lists inside of a large list.

License

Open Source License

Parameter

Parameter Description
lists a parameter
T a parameter

Declaration

public static <T> List<T> combine(List<List<T>> lists) 

Method Source Code


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

import java.util.ArrayList;

import java.util.List;

public class Main {
    /**//from  w  w w  .j  a  va2 s. co  m
     * Combines a bunch of lists inside of a large list.
     * @param lists
     * @param <T>
     * @return
     */
    public static <T> List<T> combine(List<List<T>> lists) {
        List<T> majorList = new ArrayList<T>();
        lists.forEach(majorList::addAll);
        return majorList;
    }
}

Related

  1. combine(final List r, final char sep)
  2. combine(final List dataChunks)
  3. combine(final List list, final List list2)
  4. combine(int sign, List exponentBits, List mantissaBits)
  5. combine(List r, char sep)
  6. combine(List commands, int startAt, int endAt)
  7. combine(List strlist, String delimiter)
  8. combine(List tokens, String separator)
  9. combine(List a, List b)