Java Collection Merge merge(Collection... collections)

Here you can find the source of merge(Collection... collections)

Description

merge

License

Apache License

Declaration

public static <T> List<T> merge(Collection<T>... collections) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.util.ArrayList;
import java.util.Collection;

import java.util.List;

public class Main {
    public static <T> List<T> merge(Collection<T>... collections) {
        int size = 0;
        for (Collection collection : collections) {
            size += collection.size();/* ww  w .j a va  2  s.co m*/
        }

        ArrayList<T> ret = new ArrayList<T>(size);
        for (Collection collection : collections) {
            ret.addAll(collection);
        }
        return ret;
    }
}

Related

  1. getMergedString(Collection values, String delimiter)
  2. merge(CC target, Collection a, Collection b)
  3. merge(Collection dest, Collection src)
  4. merge(Collection splits)
  5. merge(Collection strings, char separator)
  6. merge(Collection... collections)
  7. merge(Collection... elems)
  8. merge(final Collection values)
  9. merge(J just, Collection justs)