Java List Combine combineArray(List... p)

Here you can find the source of combineArray(List... p)

Description

Combine a list of object lists into one list

License

Open Source License

Parameter

Parameter Description
T a parameter
p List of object lists concerned

Return

Combined list

Declaration

public static <T> List<T> combineArray(List<T>... p) 

Method Source Code


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

import java.util.*;

public class Main {
    /**//from  w ww .ja  v a 2  s  .c om
     * Combine a list of object lists into one list
     * @param <T>
     * @param p List of object lists concerned
     * @return Combined list
     */
    public static <T> List<T> combineArray(List<T>... p) {
        List<T> c = new ArrayList<T>();
        for (int i = 0; i < p.length; ++i) {
            for (T pl : p[i]) {
                c.add(pl);
            }
        }
        return c;
    }
}

Related

  1. combine(List dest, Collection... src)
  2. combine(List list, int maxK)
  3. combine(List... dests)
  4. combineAfterIndexWithQuotes(List commands, String match)
  5. combineArray(List> data)
  6. combineAsLists(Object one, Object two)
  7. combineAux(List> collections, List objectAccumulator, List> resultList)
  8. combineFloat(List nums)
  9. combineLines(List lines)