ICollection<T> Interface

Definition

Provides methods to add and remove values.

Delphi
ICollection<T> = interface(IReadOnlyCollection<T>)

Type Parameters

T

The type of values in the collection.

Inheritance
IInterface
ICollection<T>
Derived

Properties

Count

Gets the number of values in the collection.

(Inherited from IReadOnlyCollection<T>)

Methods

Add(T)

Adds a value to the collection.

AddRange(IEnumerable<T>)

Adds the values in a sequence to the collection.

AddRange(array of T)

Adds the values in an open array to the collection.

Clear

Removes all values from the collection.

Contains(T)

Determines whether the collection contains a specific value.

(Inherited from IReadOnlyCollection<T>)
GetCount

Gets the number of values in the collection.

(Inherited from IReadOnlyCollection<T>)
GetEnumerator

Returns an enumerator that iterates through the sequence.

(Inherited from IEnumerable<T>)
IsEmpty

Determines whether the collection contains no values.

(Inherited from IReadOnlyCollection<T>)
Remove(T)

Removes the first occurrence of a value from the collection.

See also