ICollection ICollection Interface


Collection is the root of the collection hierarchy.

[Android.Runtime.Register("java/util/Collection", "", "Java.Util.ICollectionInvoker", ApiSince=1)]
[Java.Interop.JavaTypeParameters(new System.String[] { "E" })]
public interface ICollection : IDisposable, Java.Lang.IIterable
type ICollection = interface
    interface IIterable
    interface IJavaObject
    interface IDisposable


Android platform documentation

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.


Handle Handle

Gets the JNI value of the underlying Android object.

(Inherited from IJavaObject)
IsEmpty IsEmpty

Returns if this Collection contains no elements.


Add(Object) Add(Object)
AddAll(ICollection) AddAll(ICollection)
Clear() Clear()

Removes all elements from this Collection, leaving it empty (optional).

Contains(Object) Contains(Object)

Tests whether this Collection contains the specified object.

ContainsAll(ICollection) ContainsAll(ICollection)
Equals(Object) Equals(Object)

Compares the argument to the receiver, and returns true if they represent the same object using a class specific comparison.

GetHashCode() GetHashCode()

Returns an integer hash code for the receiver.

Iterator() Iterator()

Returns an instance of IIterator that may be used to access the objects contained by this Collection.

Remove(Object) Remove(Object)

Removes one instance of the specified object from this Collection if one is contained (optional).

RemoveAll(ICollection) RemoveAll(ICollection)
RetainAll(ICollection) RetainAll(ICollection)
Size() Size()

Returns a count of how many objects this Collection contains.

ToArray() ToArray()

Returns a new array containing all elements contained in this Collection.

ToArray(Object[]) ToArray(Object[])

Extension Methods

JavaCast<TResult>(IJavaObject) JavaCast<TResult>(IJavaObject)

Performs an Android runtime-checked type conversion.

JavaCast<TResult>(IJavaObject) JavaCast<TResult>(IJavaObject)
ToEnumerable(IIterable) ToEnumerable(IIterable)
ToEnumerable<T>(IIterable) ToEnumerable<T>(IIterable)

Applies to