Package java.util
Class ArrayList

Public Method addAll

boolean addAll(Collection c)

Overrides:

boolean addAll(int index, Collection c)

Overrides:

Throws:

_INSERT_METHOD_SIGNATURE_HERE_

Description:

addAll(Collection c) method:

Appends all of the elements in the specified Collection to the end of this list, in order that they are returned by the specified Collection's Iterator. The behavior of this operation is undefined if the specified Collection is modified while the operation is in progress. This implies that the behavior of this call is undifined if the specified Collection is this list, and this list is nonempty.

addAll(int index, Collection) method:

Inserts all of the elements in the specified Collection into this list, starting at the specifeid position. Shifts the element currently at that position if any and any subsequent elements to the right. The new element will appear in the list in the order that they are returned by the specified Collection's iterator.

Example

   ArrayList aList = new ArrayList(5);
   aList.add("A The first element!");
   aList.add("A The second element!");
   aList.add("A The third element!");

   for (int i = 0; i < 3; i++)
   {
      Logger.log("" + aList.get(i));
   }

   ArrayList bList = new ArrayList(2);
   bList.add("B the second element!");
   bList.add("B the third element!");

   aList.addAll(1, bList);

   for (int i = 0; i < 5; i++)
   {
      Logger.log("" + aList.get(i));
   }

The example moves the second and third element of the aList to the right and inserts the elements of the bList.