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.

傳回

Boolean

如果 SortedSet<T> 物件是 other 的超集,則為 true,否則為 falsetrue if the SortedSet<T> object is a superset of other; otherwise, false.

實作

例外狀況

othernullother 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 小於中的元素數目,則這個方法一律會傳回 otherThis method always returns false if Count is less than the number of elements in other.

如果所表示的集合 otherSortedSet<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 CountOtherwise, this method is an O(n + m) operation, where n is the number of elements in other and m is Count.

適用於