SortedList.Count 属性
定义
获取 SortedList 对象中包含的元素数。Gets the number of elements contained in a SortedList object.
public:
virtual property int Count { int get(); };
public virtual int Count { get; }
member this.Count : int
Public Overridable ReadOnly Property Count As Integer
属性值
SortedList 对象中包含的元素数。The number of elements contained in the SortedList object.
实现
注解
每个元素都是一个可作为对象进行访问的键/值对 DictionaryEntry 。Each element is a key/value pair that can be accessed as a DictionaryEntry object.
CapacitySortedList对象可存储的元素数。Capacity is the number of elements that the SortedList object can store. Count 实际在中的元素的数目 SortedList 。Count is the number of elements that are actually in the SortedList.
Capacity 始终大于或等于 Count 。Capacity is always greater than or equal to Count. 如果 Count 在 Capacity 添加元素时超过,则会通过在复制旧元素并添加新元素之前重新分配内部数组来自动增加容量。If Count exceeds Capacity while adding elements, the capacity is automatically increased by reallocating the internal array before copying the old elements and adding the new elements.
检索此属性的值是一个 O(1) 运算。Retrieving the value of this property is an O(1) operation.