Collections.AddAll(ICollection, Object[]) Method

Definition

Adds all of the specified elements to the specified collection.

[Android.Runtime.Register("addAll", "(Ljava/util/Collection;[Ljava/lang/Object;)Z", "")]
[Java.Interop.JavaTypeParameters(new System.String[] { "T" })]
public static bool AddAll (System.Collections.ICollection c, params Java.Lang.Object[] elements);
[<Android.Runtime.Register("addAll", "(Ljava/util/Collection;[Ljava/lang/Object;)Z", "")>]
[<Java.Interop.JavaTypeParameters(new System.String[] { "T" })>]
static member AddAll : System.Collections.ICollection * Java.Lang.Object[] -> bool

Parameters

c
ICollection

the collection into which elements are to be inserted

elements
Object[]

the elements to insert into c

Returns

true if the collection changed as a result of the call

Attributes

Remarks

Adds all of the specified elements to the specified collection. Elements to be added may be specified individually or as an array. The behaviour of this convenience method is similar to that of cc.addAll(Collections.unmodifiableList(Arrays.asList(elements))).

When elements are specified individually, this method provides a convenient way to add a few elements to an existing collection:

Collections.addAll(flavors, "Peaches 'n Plutonium", "Rocky Racoon");

Added in 1.5.

Java documentation for java.util.Collections.addAll(java.util.Collection<? super T>, T...).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to