Skip to content

T_Cyjb_Collections_ReadOnlyCharSet

CYJB edited this page Mar 20, 2024 · 7 revisions

ReadOnlyCharSet 类

表示字符的只读有序集合。

继承层次

System.Object
  Cyjb.Collections.ObjectModel.ReadOnlyCollectionBase(Char)
    Cyjb.Collections.ObjectModel.ReadOnlySetBase(Char)
      Cyjb.Collections.ReadOnlyCharSet
Namespace: Cyjb.Collections
Assembly: Cyjb (in Cyjb.dll) Version: 1.0.23+7750dd8e971297c5fa962a3bee37fb78f72793f6

语法

C#

[SerializableAttribute]
public sealed class ReadOnlyCharSet : ReadOnlySetBase<char>, 
	ICollection<char>, IEnumerable<char>, IEnumerable, IEquatable<ReadOnlyCharSet>, 
	IRangeCollection<char>

The ReadOnlyCharSet type exposes the following members.

构造函数

 

名称 说明
公共方法 ReadOnlyCharSet() 初始化 ReadOnlyCharSet 类的新实例。
公共方法 ReadOnlyCharSet(IEnumerable(Char)) 使用指定的元素初始化 ReadOnlyCharSet 类的新实例。
  Back to Top

属性

 

名称 说明
公共属性 Count 获取当前集合包含的字符数。 (重写 ReadOnlyCollectionBase(T).Count.)
  Back to Top

方法

 

名称 说明
公共方法 Contains 确定当前集合是否包含指定字符。 (重写 ReadOnlyCollectionBase(T).Contains(T).)
公共方法 CopyTo 从特定的 Array 索引处开始,将当前集合 的元素复制到一个 Array 中。 (继承自 ReadOnlyCollectionBase(T)。)
公共方法 Equals(Object) 确定指定对象是否等于当前对象。 (重写 Object.Equals(Object).)
公共方法 Equals(ReadOnlyCharSet) 指示当前对象是否等于同一类型的另一个对象。
公共方法静态成员 FromRange 从指定的范围字符串初始化 ReadOnlyCharSet 类的新实例。
公共方法 GetEnumerator 返回一个循环访问集合的枚举器。 (重写 ReadOnlyCollectionBase(T).GetEnumerator().)
公共方法 GetHashCode 返回当前对象的哈希代码。 (重写 Object.GetHashCode().)
公共方法 GetType Gets the Type of the current instance. (继承自 Object。)
公共方法 IsProperSubsetOf 确定当前集合是否为指定集合的真子集合。 (重写 ReadOnlySetBase(T).IsProperSubsetOf(IEnumerable(T)).)
公共方法 IsProperSupersetOf 确定当前集合是否为指定集合的真超集合。 (重写 ReadOnlySetBase(T).IsProperSupersetOf(IEnumerable(T)).)
公共方法 IsSubsetOf 确定当前集合是否为指定集合的子集合。 (重写 ReadOnlySetBase(T).IsSubsetOf(IEnumerable(T)).)
公共方法 IsSupersetOf 确定当前集合是否为指定集合的超集合。 (重写 ReadOnlySetBase(T).IsSupersetOf(IEnumerable(T)).)
公共方法 Overlaps 确定当前集合是否与指定的集合重叠。 (重写 ReadOnlySetBase(T).Overlaps(IEnumerable(T)).)
公共方法 RangeCount 返回当前字符集合包含的范围个数。
公共方法 Ranges 返回一个循环访问字符范围的枚举器。
公共方法 SetEquals 确定当前集合与指定的集合中是否包含相同的元素。 (重写 ReadOnlySetBase(T).SetEquals(IEnumerable(T)).)
公共方法 ToString 返回当前集合的字符串表示。 (重写 Object.ToString().)
  Back to Top

运算符

 

名称 说明
公共运算符静态成员 Addition 返回两个字符集合的和集(union)。
公共运算符静态成员 BitwiseAnd 返回两个字符集合的与集(intersect)。
公共运算符静态成员 BitwiseOr 返回两个字符集合的或集(union)。
公共运算符静态成员 ExclusiveOr 返回两个字符集合的异或集(symmetric except)。
公共运算符静态成员 LogicalNot 返回当前字符集合的非集(negated)。
公共运算符静态成员 OnesComplement 返回当前字符集合的补集(negated)。
公共运算符静态成员 Subtraction 返回两个字符集合的差集(except)。
  Back to Top

扩展方法

 

名称 说明
公共扩展器方法 AddRange(Char) 将指定集合的元素添加到当前集合中。 (由 CollectionUtil 定义。)
公共扩展器方法 AsReadOnly(Char) 返回当前集合的只读包装。 (由 CollectionUtil 定义。)
公共扩展器方法 IsDistinct(Char) 判断序列中是否不包含重复元素。 (由 EnumerableUtil 定义。)
  Back to Top

Remarks

ReadOnlyCharSet 类采用类似位示图的树状位压缩数组存储字符, 关于该数据结构的更多解释,请参见我的博文 《基于树状位压缩数组的字符集合》

参见

Reference

Cyjb.Collections 命名空间

Other Resources

《基于树状位压缩数组的字符集合》
Clone this wiki locally