HashSet<T>.ICollection<T>.Add(T) 메서드

정의

ICollection<T> 개체에 항목을 추가합니다.

 virtual void System.Collections.Generic.ICollection<T>.Add(T item) = System::Collections::Generic::ICollection<T>::Add;
void ICollection<T>.Add (T item);
abstract member System.Collections.Generic.ICollection<T>.Add : 'T -> unit
override this.System.Collections.Generic.ICollection<T>.Add : 'T -> unit
Sub Add (item As T) Implements ICollection(Of T).Add

매개 변수

item
T

ICollection<T> 개체에 추가할 개체입니다.

구현

예외

ICollection<T>이 읽기 전용인 경우

설명

가 보다 Capacity작으면 Count 이 메서드는 O(1) 작업입니다. 새 요소를 수용하기 위해 용량을 늘려야 하는 경우 이 메서드는 O(n) 작업이 됩니다. 여기서 n 은 입니다 Count.

적용 대상