ImmutableSortedSet<T>.Enumerator 結構

定義

列舉二進位樹狀目錄的內容。Enumerates the contents of a binary tree.

NuGet 套件System.Collections.Immutable (關於固定集合及其安裝方法)NuGet package: System.Collections.Immutable (about immutable collections and how to install)

public: value class ImmutableSortedSet<T>::Enumerator : System::Collections::Generic::IEnumerator<T>
public struct ImmutableSortedSet<T>.Enumerator : System.Collections.Generic.IEnumerator<T>
type ImmutableSortedSet<'T>.Enumerator = struct
    interface IEnumerator<'T>
    interface IEnumerator
    interface IDisposable
Public Structure ImmutableSortedSet(Of T).Enumerator
Implements IEnumerator(Of T)

類型參數

T
繼承
ImmutableSortedSet<T>.Enumerator
實作

備註

這個結構應該與其他兩個二進位樹狀列舉值保持同步: System.Collections.Immutable.ImmutableList<T>.EnumeratorSystem.Collections.Immutable.ImmutableSortedDictionary<TKey,TValue>.EnumeratorThis structure should be kept synchronized with the other two binary tree enumerators: System.Collections.Immutable.ImmutableList<T>.Enumerator and System.Collections.Immutable.ImmutableSortedDictionary<TKey,TValue>.Enumerator.

警告

當此枚舉器當做實值型別使用時 (也就是未加上框時), 請勿將它指派給第二個變數或將它傳遞給另一個方法來複製它。When this enumerator is used as a value type (that is, when it isn't boxed), do not copy it by assigning it to a second variable or by passing it to another method. 處置此枚舉器時, 它會將可變動的參考型別堆疊傳回給資源集區, 而且如果複製了值型別枚舉器 (這在您傳遞值時很容易就會發生), 就會有一個已存在的堆疊的風險傳回給資源集區的其中一個列舉值複本可能仍在使用, 因而導致資料損毀或發生例外狀況。When this enumerator is disposed of, it returns a mutable reference type stack to a resource pool, and if the value type enumerator is copied (which can easily happen unintentionally if you pass the value around), there is a risk that a stack that has already been returned to the resource pool may still be in use by one of the enumerator copies, leading to data corruption or exceptions.

屬性

Current

取得位於目前列舉值位置的項目。Gets the element at the current position of the enumerator.

NuGet 套件System.Collections.Immutable (關於固定集合及其安裝方法)NuGet package: System.Collections.Immutable (about immutable collections and how to install)

方法

Dispose()

ImmutableSortedSet<T>.Enumerator 類別的目前執行個體所使用的資源釋出。Releases the resources used by the current instance of the ImmutableSortedSet<T>.Enumerator class.

NuGet 套件System.Collections.Immutable (關於固定集合及其安裝方法)NuGet package: System.Collections.Immutable (about immutable collections and how to install)

MoveNext()

將列舉程式往前推至不可變排序資料集的下一個項目。Advances the enumerator to the next element of the immutable sorted set.

NuGet 套件System.Collections.Immutable (關於固定集合及其安裝方法)NuGet package: System.Collections.Immutable (about immutable collections and how to install)

Reset()

將列舉程式設定為它的初始位置,這是在不可變排序資料集中的第一個項目之前。Sets the enumerator to its initial position, which is before the first element in the immutable sorted set.

NuGet 套件System.Collections.Immutable (關於固定集合及其安裝方法)NuGet package: System.Collections.Immutable (about immutable collections and how to install)

明確介面實作

IEnumerator.Current

目前的元素。The current element.

適用於

執行緒安全性

此型別具備執行緒安全。This type is thread safe.