ArrayList 成员

使用大小可按需动态增加的数组实现 IList 接口。

下表列出了由 ArrayList 类型公开的成员。

公共构造函数

  名称 说明
Public method Supported by the .NET Compact Framework ArrayList 已重载。初始化 ArrayList 类的新实例。

页首

公共属性

  名称 说明
Public property Supported by the .NET Compact Framework Capacity 获取或设置 ArrayList 可包含的元素数。
Public property Supported by the .NET Compact Framework Count 获取 ArrayList 中实际包含的元素数。
Public property Supported by the .NET Compact Framework IsFixedSize 获取一个值,该值指示 ArrayList 是否具有固定大小。
Public property Supported by the .NET Compact Framework IsReadOnly 获取一个值,该值指示 ArrayList 是否为只读。
Public property Supported by the .NET Compact Framework IsSynchronized 获取一个值,该值指示是否同步对 ArrayList 的访问(线程安全)。
Public property Supported by the .NET Compact Framework Item 获取或设置指定索引处的元素。
Public property Supported by the .NET Compact Framework SyncRoot 获取可用于同步 ArrayList 访问的对象。

页首

公共方法

(请参见 受保护的方法 )

  名称 说明
Public method Static Adapter 为特定的 IList 创建 ArrayList 包装。
Public method Supported by the .NET Compact Framework Add 将对象添加到 ArrayList 的结尾处。
Public method Supported by the .NET Compact Framework AddRange ICollection 的元素添加到 ArrayList 的末尾。
Public method Supported by the .NET Compact Framework BinarySearch 已重载。 使用对分检索算法在已排序的 ArrayList 或它的一部分中查找特定元素。
Public method Supported by the .NET Compact Framework Clear ArrayList 中移除所有元素。
Public method Supported by the .NET Compact Framework Clone 创建 ArrayList 的浅表副本。
Public method Supported by the .NET Compact Framework Contains 确定某元素是否在 ArrayList 中。
Public method Supported by the .NET Compact Framework CopyTo 已重载。 将 ArrayList 或它的一部分复制到一维数组中。
Public method Supported by the .NET Compact Framework Equals  已重载。 确定两个 Object 实例是否相等。 (从 Object 继承。)
Public method Static FixedSize 已重载。 返回具有固定大小的列表包装,其中的元素允许修改,但不允许添加或移除。
Public method GetEnumerator 已重载。 返回循环访问 ArrayList 的枚举数。
Public method Supported by the .NET Compact Framework GetHashCode  用作特定类型的哈希函数。GetHashCode 适合在哈希算法和数据结构(如哈希表)中使用。 (从 Object 继承。)
Public method GetRange 返回 ArrayList,它表示源 ArrayList 中元素的子集。
Public method Supported by the .NET Compact Framework GetType  获取当前实例的 Type。 (从 Object 继承。)
Public method Supported by the .NET Compact Framework IndexOf 已重载。 返回 ArrayList 或它的一部分中某个值的第一个匹配项的从零开始的索引。
Public method Supported by the .NET Compact Framework Insert 将元素插入 ArrayList 的指定索引处。
Public method Supported by the .NET Compact Framework InsertRange 将集合中的某个元素插入 ArrayList 的指定索引处。
Public method LastIndexOf 已重载。 返回 ArrayList 或它的一部分中某个值的最后一个匹配项的从零开始的索引。
Public method Static ReadOnly 已重载。 返回只读的列表包装。
Public method Static Supported by the .NET Compact Framework ReferenceEquals  确定指定的 Object 实例是否是相同的实例。 (从 Object 继承。)
Public method Supported by the .NET Compact Framework Remove ArrayList 中移除特定对象的第一个匹配项。
Public method Supported by the .NET Compact Framework RemoveAt 移除 ArrayList 的指定索引处的元素。
Public method Supported by the .NET Compact Framework RemoveRange ArrayList 中移除一定范围的元素。
Public method Static Repeat 返回 ArrayList,它的元素是指定值的副本。
Public method Supported by the .NET Compact Framework Reverse 已重载。 将 ArrayList 或它的一部分中元素的顺序反转。
Public method SetRange 将集合中的元素复制到 ArrayList 中一定范围的元素上。
Public method Supported by the .NET Compact Framework Sort 已重载。 对 ArrayList 或它的一部分中的元素进行排序。
Public method Static Supported by the .NET Compact Framework Synchronized 已重载。 返回同步的(线程安全)列表包装。
Public method Supported by the .NET Compact Framework ToArray 已重载。 将 ArrayList 的元素复制到新数组中。
Public method Supported by the .NET Compact Framework ToString  返回表示当前 ObjectString。 (从 Object 继承。)
Public method Supported by the .NET Compact Framework TrimToSize 将容量设置为 ArrayList 中元素的实际数目。

页首

受保护的方法

  名称 说明
Protected method Supported by the .NET Compact Framework Finalize  允许 Object 在“垃圾回收”回收 Object 之前尝试释放资源并执行其他清理操作。 (从 Object 继承。)
Protected method Supported by the .NET Compact Framework MemberwiseClone  创建当前 Object 的浅表副本。 (从 Object 继承。)

页首

请参见

参考

ArrayList 类
System.Collections 命名空间
IList
System.Collections.Generic.List

其他资源

在集合中执行不区分区域性的字符串操作