Here you can find the source of addAll(Collection ret, Object[] elements)
Parameter | Description |
---|---|
ret | a parameter |
elements | a parameter |
@SuppressWarnings({ "rawtypes", "unchecked" }) public static void addAll(Collection ret, Object[] elements)
//package com.java2s; //License from project: Open Source License import java.util.Collection; import java.util.Iterator; public class Main { /**/*w w w.ja v a 2 s. co m*/ * @param ret * @param elements */ @SuppressWarnings({ "rawtypes", "unchecked" }) public static void addAll(Collection ret, Object[] elements) { if (elements != null) for (int i = 0; i < elements.length; i++) ret.add(elements[i]); } public static void addAll(Collection<String> ret, String[] elements) { if (elements != null) for (int i = 0; i < elements.length; i++) ret.add(elements[i]); } @SuppressWarnings({ "rawtypes", "unchecked" }) public static void addAll(Collection ret, Iterator elements) { if (elements != null) while (elements.hasNext()) ret.add(elements.next()); } }