add two ArrayList together - Android java.util

Android examples for java.util:ArrayList

Description

add two ArrayList together

Demo Code


//package com.java2s;

import java.util.ArrayList;
import java.util.Collection;

public class Main {
    public final static <T> void add(ArrayList<T> origin, ArrayList<T> list) {
        if (origin == null) {
            throw new IllegalArgumentException("");
        }/*from   w  w w  . j a v a 2 s .  co  m*/

        if (list == null || list.size() == 0) {
            return;
        }

        origin.addAll(list);
    }

    public final static int size(Collection c) {
        return c == null ? 0 : c.size();
    }
}

Related Tutorials