Here you can find the source of addArray(Collection
Parameter | Description |
---|---|
col | collection to add to |
array | array to add to collection |
public static <T> Collection<T> addArray(Collection<T> col, T[] array)
//package com.java2s; //License from project: Open Source License import java.util.Collection; public class Main { /**/*from w ww.j ava 2s. c om*/ * Adds the whole array to the collection. * * @param col collection to add to * @param array array to add to collection * @return collection */ public static <T> Collection<T> addArray(Collection<T> col, T[] array) { if (array == null) { return col; } for (T a : array) { col.add(a); } return col; } }