Java Collection Add addAll(C collection, T... elements)

Here you can find the source of addAll(C collection, T... elements)

Description

add All

License

Open Source License

Declaration

public static <T, C extends Collection<T>> C addAll(C collection, T... elements) 

Method Source Code

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

import java.util.Arrays;
import java.util.Collection;

import java.util.List;

public class Main {
    public static <T, C extends Collection<T>> C addAll(C collection, T... elements) {
        collection.addAll(Arrays.asList(elements));
        return collection;
    }//from   w  w w .  j  a v a 2  s  .  c o  m

    public static <T> List<T> asList(T... elements) {
        return Arrays.asList(elements);
    }
}

Related

  1. add(Collection collection, T object)
  2. add(Collection collection, T object)
  3. add_all(Collection target, Collection source)
  4. add_news(Collection target, Collection to_add)
  5. addAll(C collection, Iterable add)
  6. addAll(Collection collection, Iterator iterator)
  7. addAll(Collection collection, Object[] array)
  8. addAll(Collection collection, Object[] array)
  9. addAll(Collection ret, Object[] elements)