Java.Util.AbstractCollection.Clear Method
Removes all elements from this Collection, leaving it empty (optional).

Syntax

[Android.Runtime.Register("clear", "()V", "GetClearHandler")]
public virtual void Clear ()

See Also

AbstractCollection.Iterator
AbstractCollection.IsEmpty
AbstractCollection.Size

Exceptions

TypeReason
Java.Lang.UnsupportedOperationExceptionit the iterator does not support removing elements from this Collection

Remarks

Removes all elements from this Collection, leaving it empty (optional). This implementation iterates over this Collection and calls the remove method on each element. If the iterator does not support removal of elements, an UnsupportedOperationException is thrown.

Concrete implementations usually can clear a Collection more efficiently and should therefore overwrite this method.

[Android Documentation]

Requirements

Namespace: Java.Util
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 1