Java Collection Add addAll(final Collection coll, final Object[] array)

Here you can find the source of addAll(final Collection coll, final Object[] array)

Description

Convenience method that adds all members of an array to a collection.

License

Open Source License

Parameter

Parameter Description
coll the collection to add to
array the array to value to add

Declaration

public static void addAll(final Collection coll, final Object[] array) 

Method Source Code

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

import java.util.Collection;

public class Main {
    /**/*w  ww.ja  v  a  2 s . c o  m*/
     * Convenience method that adds all members of an array to a collection.
     *
     * @param coll the collection to add to
     * @param array the array to value to add
     */
    public static void addAll(final Collection coll, final Object[] array) {
        for (int i = 0; i < array.length; i++) {
            coll.add(array[i]);
        }
    }
}

Related

  1. addAll(Collection left, Collection right)
  2. addAll(Collection t1, Iterable t2)
  3. addAll(Collection target, Collection source)
  4. addAll(Collection target, Iterable source)
  5. addAll(Collection target, S[] source)
  6. addAll(final Collection newItems, final Collection existingItems)
  7. addAll(final Collection c, final E... array)
  8. addAll(final Collection thingsToBeAddedTo, final Collection thingsToAdd)
  9. addAll(final Collection coll, final T... objs)