Java Collection Add add_all(Collection target, Collection source)

Here you can find the source of add_all(Collection target, Collection source)

Description

adall

License

Open Source License

Declaration

@SuppressWarnings("unchecked")
    public static <T> Collection<? extends T> add_all(Collection<? extends T> target,
            Collection<? extends T> source) 

Method Source Code

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

import java.util.Collection;

public class Main {
    @SuppressWarnings("unchecked")
    public static <T> Collection<? extends T> add_all(Collection<? extends T> target,
            Collection<? extends T> source) {
        ((Collection<T>) target).addAll(source);
        return target;
    }/*from  www  .ja v a2 s.  co  m*/

    public static <T> void addAll(Collection<T> target, Iterable<? extends T> source) {
        for (T e : source)
            target.add(e);
    }

    public static <T> void addAll(Collection<T> collection, T[] array) {
        for (int i = 0; i < array.length; ++i)
            collection.add(array[i]);
    }
}

Related

  1. add(Collection c, Object o)
  2. add(Collection collection, T object)
  3. add(Collection collection, T object)
  4. add_news(Collection target, Collection to_add)
  5. addAll(C collection, Iterable add)
  6. addAll(C collection, T... elements)
  7. addAll(Collection collection, Iterator iterator)