SortedSet<T>.IsProperSubsetOf(IEnumerable<T>) 方法

定義

判斷 SortedSet<T> 物件是否為指定之集合的真子集。Determines whether a SortedSet<T> object is a proper subset of the specified collection.

public:
 virtual bool IsProperSubsetOf(System::Collections::Generic::IEnumerable<T> ^ other);
public bool IsProperSubsetOf (System.Collections.Generic.IEnumerable<T> other);
abstract member IsProperSubsetOf : seq<'T> -> bool
override this.IsProperSubsetOf : seq<'T> -> bool
Public Function IsProperSubsetOf (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 proper subset of other; otherwise, false.

實作

例外狀況

othernullother is null.

備註

空集合是任何其他集合的適當子集。An empty set is a proper subset of any other collection. 因此, true 如果目前物件所表示的集合是空的,則這個方法會傳回, SortedSet<T> 除非該 other 參數也是空的集合。Therefore, this method returns true if the collection represented by the current SortedSet<T> object is empty unless the other parameter is also an empty set.

false如果 Count 大於或等於中的元素數目,則這個方法一律會傳回 otherThis method always returns false if Count is greater than or equal to 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, then this method is an O(n) operation. 否則,此方法是一 O(n + m) 項作業,其中 n 是, Count 而是中的專案 motherOtherwise, this method is an O(n + m) operation, where n is Count and m is the number of elements in other.

適用於