Java Collection Add addAll(Collection c, T[] a)

Here you can find the source of addAll(Collection c, T[] a)

Description

INTERNAL: Adds all elements in the array to the collection.

License

Apache License

Declaration

public static <T> void addAll(Collection<T> c, T[] a) 

Method Source Code

//package com.java2s;
/*/* w  w w. ja  va 2  s  .  co m*/
 * #!
 * Ontopia Engine
 * #-
 * Copyright (C) 2001 - 2013 The Ontopia Project
 * #-
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *      http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * !#
 */

import java.util.Collection;

public class Main {
    /**
     * INTERNAL: Adds all elements in the array to the collection.
     */
    public static <T> void addAll(Collection<T> c, T[] a) {
        for (int i = 0; i < a.length; i++) {
            c.add(a[i]);
        }
    }
}

Related

  1. addAll(Collection collection, E... args)
  2. addAll(Collection collection, Iterable iterable)
  3. addAll(Collection collection, Iterator iterator)
  4. addAll(Collection pCollection, Iterator pIterator)
  5. addAll(Collection integerCollection, int[] intArray)
  6. addAll(Collection col, T[] arr)
  7. addAll(Collection coll, T... elems)
  8. addAll(Collection coll1, Collection coll2)
  9. addAll(Collection collection, Collection toAdd)