SortedSet<T>.IsSupersetOf(IEnumerable<T>) 方法
定义
确定 SortedSet<T> 对象是否为指定集合的超集。Determines whether a SortedSet<T> object is a superset of the specified collection.
public:
virtual bool IsSupersetOf(System::Collections::Generic::IEnumerable<T> ^ other);
public bool IsSupersetOf (System.Collections.Generic.IEnumerable<T> other);
abstract member IsSupersetOf : seq<'T> -> bool
override this.IsSupersetOf : seq<'T> -> bool
Public Function IsSupersetOf (other As IEnumerable(Of T)) As Boolean
参数
- other
- IEnumerable<T>
要与当前的 SortedSet<T> 对象进行比较的集合。The collection to compare to the current SortedSet<T> object.
返回
如果 SortedSet<T> 对象是 other 的超集,则为 true;否则为 false。true if the SortedSet<T> object is a superset of other; otherwise, false.
实现
例外
other 为 null。other is null.
注解
所有集合(包括空集)均为空集的超集。All collections, including the empty set, are supersets of the empty set. 因此, true 如果由参数表示的集合为空,则此方法返回 other ,即使当前 SortedSet<T> 对象为空也是如此。Therefore, this method returns true if the collection represented by the other parameter is empty, even if the current SortedSet<T> object is empty.
false如果 Count 小于中的元素数,则此方法将始终返回 other 。This method always returns false if Count is less than the number of elements in other.
如果由表示的集合 other 是 SortedSet<T> 具有与当前对象相同的相等比较器的集合 SortedSet<T> ,则此方法为 O(n) 操作。If the collection represented by other is a SortedSet<T> collection with the same equality comparer as the current SortedSet<T> object, this method is an O(n) operation. 否则,此方法是一个 O(n + m) 操作,其中 n 是和中的元素的 other 数目 m Count 。Otherwise, this method is an O(n + m) operation, where n is the number of elements in other and m is Count.