Here you can find the source of mergeLists(final T... array)
Parameter | Description |
---|---|
array | The source arrays |
array
public static <T> ArrayList<T> mergeLists(final T... array)
//package com.java2s; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; public class Main { /**/*ww w. j av a 2s. c om*/ * Merge arrays * * @param array The source arrays * @return A collection that contains the contents of all the arrays passed to <code>array</code> */ public static <T> ArrayList<T> mergeLists(final T... array) { final ArrayList<T> retValue = new ArrayList<T>(); Collections.addAll(retValue, array); return retValue; } public static <T> int addAll(final T[] source, final Collection<T> destination) { int count = 0; for (final T sourceItem : source) { destination.add(sourceItem); ++count; } return count; } }