BitArray 成员
管理位值的压缩数组,该值表示为布尔值,其中 true 表示位是打开的 (1),false 表示位是关闭的 (0)。
下表列出了由 BitArray 类型公开的成员。
公共构造函数
名称 | 说明 | |
---|---|---|
BitArray | 已重载。初始化 BitArray 类的新实例,可指定该实例的容量和初始值。 |
页首
公共属性
名称 | 说明 | |
---|---|---|
Count | 获取 BitArray 中包含的元素数。 | |
IsReadOnly | 获取一个值,该值指示 BitArray 是否为只读。 | |
IsSynchronized | 获取一个值,该值指示是否同步对 BitArray 的访问(线程安全)。 | |
Item | 获取或设置 BitArray 中特定位置的位的值。 | |
Length | 获取或设置 BitArray 中元素的数目。 | |
SyncRoot | 获取可用于同步 BitArray 访问的对象。 |
页首
公共方法
名称 | 说明 | |
---|---|---|
And | 对当前 BitArray 中的元素和指定的 BitArray 中的相应元素执行按位 AND 运算。 | |
Clone | 创建 BitArray 的浅表副本。 | |
CopyTo | 从目标数组的指定索引处开始将整个 BitArray 复制到兼容的一维 Array。 | |
Equals | 已重载。 确定两个 Object 实例是否相等。 (从 Object 继承。) | |
Get | 获取 BitArray 中特定位置处的位的值。 | |
GetEnumerator | 返回循环访问 BitArray 的枚举数。 | |
GetHashCode | 用作特定类型的哈希函数。GetHashCode 适合在哈希算法和数据结构(如哈希表)中使用。 (从 Object 继承。) | |
GetType | 获取当前实例的 Type。 (从 Object 继承。) | |
Not | 反转当前 BitArray 中的所有位值,以便将设置为 true 的元素更改为 false;将设置为 false 的元素更改为 true。 | |
Or | 对当前 BitArray 中的元素和指定的 BitArray 中的相应元素执行按位“或”运算。 | |
ReferenceEquals | 确定指定的 Object 实例是否是相同的实例。 (从 Object 继承。) | |
Set | 将 BitArray 中特定位置处的位设置为指定值。 | |
SetAll | 将 BitArray 中的所有位设置为指定值。 | |
ToString | 返回表示当前 Object 的 String。 (从 Object 继承。) | |
Xor | 对当前 BitArray 中的元素和指定的 BitArray 中的相应元素执行按位“异或”运算。 |
页首
请参见
参考
BitArray 类
System.Collections 命名空间
System.Collections.Generic