ImmutableArray<T>.Builder ImmutableArray<T>.Builder ImmutableArray<T>.Builder ImmutableArray<T>.Builder Class

定義

可寫入的陣列存取子,其可轉換為 ImmutableArray<T> 執行個體而不需配置額外的記憶體。A writable array accessor that can be converted into an ImmutableArray<T> instance without allocating extra memory.

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

public: ref class ImmutableArray<T>::Builder sealed : System::Collections::Generic::ICollection<T>, System::Collections::Generic::IEnumerable<T>, System::Collections::Generic::IList<T>, System::Collections::Generic::IReadOnlyCollection<T>, System::Collections::Generic::IReadOnlyList<T>
public sealed class ImmutableArray<T>.Builder : System.Collections.Generic.ICollection<T>, System.Collections.Generic.IEnumerable<T>, System.Collections.Generic.IList<T>, System.Collections.Generic.IReadOnlyCollection<T>, System.Collections.Generic.IReadOnlyList<T>
type ImmutableArray<'T>.Builder = class
    interface ICollection<'T>
    interface seq<'T>
    interface IEnumerable
    interface IList<'T>
    interface IReadOnlyCollection<'T>
    interface IReadOnlyList<'T>
Public NotInheritable Class ImmutableArray(Of T).Builder
Implements ICollection(Of T), IEnumerable(Of T), IList(Of T), IReadOnlyCollection(Of T), IReadOnlyList(Of T)

類型參數

T
繼承
ImmutableArray<T>.BuilderImmutableArray<T>.BuilderImmutableArray<T>.BuilderImmutableArray<T>.Builder
實作

屬性

Capacity Capacity Capacity Capacity

取得或設定間隔陣列的長度。Gets or sets the length of the internal array. 如果設定的內部陣列不是所指定長度,則它會重新配置為指定的容量。When set, the internal array is reallocated to the given capacity if it is not already the specified length.

Count Count Count Count

取得或設定陣列中的項目數目。Gets or sets the number of items in the array.

Item[Int32] Item[Int32] Item[Int32] Item[Int32]

取得或設定在指定索引位置的項目。Gets or sets the item at the specified index.

方法

Add(T) Add(T) Add(T) Add(T)

將指定的項目加入至陣列。Adds the specified item to the array.

AddRange(IEnumerable<T>) AddRange(IEnumerable<T>) AddRange(IEnumerable<T>) AddRange(IEnumerable<T>)

將指定的項目加入至陣列尾端。Adds the specified items to the end of the array.

AddRange(ImmutableArray<T>) AddRange(ImmutableArray<T>) AddRange(ImmutableArray<T>) AddRange(ImmutableArray<T>)

將指定的項目加入至陣列尾端。Adds the specified items to the end of the array.

AddRange(ImmutableArray<T>) AddRange(ImmutableArray<T>) AddRange(ImmutableArray<T>) AddRange(ImmutableArray<T>)

將指定的項目加入至陣列尾端。Adds the specified items to the end of the array.

AddRange(ImmutableArray<T>, Int32) AddRange(ImmutableArray<T>, Int32) AddRange(ImmutableArray<T>, Int32) AddRange(ImmutableArray<T>, Int32)

將指定的項目加入至陣列尾端。Adds the specified items to the end of the array.

AddRange(T[]) AddRange(T[]) AddRange(T[]) AddRange(T[])

將指定的項目加入至陣列尾端。Adds the specified items to the end of the array.

AddRange(T[], Int32) AddRange(T[], Int32) AddRange(T[], Int32) AddRange(T[], Int32)

將指定的項目加入至陣列尾端。Adds the specified items to the end of the array.

AddRange<TDerived>(ImmutableArray<TDerived>) AddRange<TDerived>(ImmutableArray<TDerived>) AddRange<TDerived>(ImmutableArray<TDerived>) AddRange<TDerived>(ImmutableArray<TDerived>)

將衍生自目前陣列中之類型的指定項目加入至陣列尾端。Adds the specified items that derive from the type currently in the array, to the end of the array.

AddRange<TDerived>(ImmutableArray<TDerived>) AddRange<TDerived>(ImmutableArray<TDerived>) AddRange<TDerived>(ImmutableArray<TDerived>) AddRange<TDerived>(ImmutableArray<TDerived>)

將衍生自目前陣列中之類型的指定項目加入至陣列尾端。Adds the specified items that derive from the type currently in the array, to the end of the array

AddRange<TDerived>(TDerived[]) AddRange<TDerived>(TDerived[]) AddRange<TDerived>(TDerived[]) AddRange<TDerived>(TDerived[])

將衍生自目前陣列中之類型的指定項目加入至陣列尾端。Adds the specified items that derive from the type currently in the array, to the end of the array.

Clear() Clear() Clear() Clear()

從陣列中移除所有項目。Removes all items from the array.

Contains(T) Contains(T) Contains(T) Contains(T)

判斷陣列是否包含特定值。Determines whether the array contains a specific value.

CopyTo(T[], Int32) CopyTo(T[], Int32) CopyTo(T[], Int32) CopyTo(T[], Int32)

將目前的內容複製至指定的陣列。Copies the current contents to the specified array.

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

判斷指定的物件是否等於目前的物件。Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetEnumerator() GetEnumerator() GetEnumerator() GetEnumerator()

取得可用於逐一查看集合的物件。Gets an object that can be used to iterate through the collection.

GetHashCode() GetHashCode() GetHashCode() GetHashCode()

做為預設雜湊函式。Serves as the default hash function.

(Inherited from Object)
GetType() GetType() GetType() GetType()

取得目前執行個體的 TypeGets the Type of the current instance.

(Inherited from Object)
IndexOf(T) IndexOf(T) IndexOf(T) IndexOf(T)

判斷陣列中特定項目的索引。Determines the index of a specific item in the array.

IndexOf(T, Int32) IndexOf(T, Int32) IndexOf(T, Int32) IndexOf(T, Int32)

判斷指定項目的索引。Determines the index of the specified item.

IndexOf(T, Int32, Int32) IndexOf(T, Int32, Int32) IndexOf(T, Int32, Int32) IndexOf(T, Int32, Int32)

判斷指定項目的索引。Determines the index of the specified item.

IndexOf(T, Int32, Int32, IEqualityComparer<T>) IndexOf(T, Int32, Int32, IEqualityComparer<T>) IndexOf(T, Int32, Int32, IEqualityComparer<T>) IndexOf(T, Int32, Int32, IEqualityComparer<T>)

判斷指定項目的索引。Determines the index for the specified item.

Insert(Int32, T) Insert(Int32, T) Insert(Int32, T) Insert(Int32, T)

將項目插入陣列中指定的索引位置。Inserts an item in the array at the specified index.

ItemRef(Int32) ItemRef(Int32) ItemRef(Int32) ItemRef(Int32)

取得位於指定索引元素的唯讀參考。Gets a read-only reference to the element at the specified index.

LastIndexOf(T) LastIndexOf(T) LastIndexOf(T) LastIndexOf(T)

判斷此陣列中指定項目最後出現的以 0 起始索引。Determines the 0-based index of the last occurrence of the specified item in this array.

LastIndexOf(T, Int32) LastIndexOf(T, Int32) LastIndexOf(T, Int32) LastIndexOf(T, Int32)

判斷此陣列中指定項目最後出現的以 0 起始索引。Determines the 0-based index of the last occurrence of the specified item in this array.

LastIndexOf(T, Int32, Int32) LastIndexOf(T, Int32, Int32) LastIndexOf(T, Int32, Int32) LastIndexOf(T, Int32, Int32)

判斷此陣列中指定項目最後出現的以 0 起始索引。Determines the 0-based index of the last occurrence of the specified item in this array.

LastIndexOf(T, Int32, Int32, IEqualityComparer<T>) LastIndexOf(T, Int32, Int32, IEqualityComparer<T>) LastIndexOf(T, Int32, Int32, IEqualityComparer<T>) LastIndexOf(T, Int32, Int32, IEqualityComparer<T>)

判斷此陣列中指定項目最後出現的以 0 起始索引。Determines the 0-based index of the last occurrence of the specified item in this array.

MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

建立目前 Object 的淺層複本 (Shallow Copy)。Creates a shallow copy of the current Object.

(Inherited from Object)
MoveToImmutable() MoveToImmutable() MoveToImmutable() MoveToImmutable()

擷取內部陣列當成 ImmutableArray<T>,並以零長度陣列取代它。Extracts the internal array as an ImmutableArray<T> and replaces it with a zero length array.

Remove(T) Remove(T) Remove(T) Remove(T)

將指定的項目移除。Removes the specified element.

RemoveAt(Int32) RemoveAt(Int32) RemoveAt(Int32) RemoveAt(Int32)

從陣列中移除指定索引位置的項目。Removes the item at the specified index from the array.

Reverse() Reverse() Reverse() Reverse()

反轉整個集合中項目的順序。Reverses the order of elements in the collection.

Sort() Sort() Sort() Sort()

為陣列的內容排序。Sorts the contents of the array.

Sort(Comparison<T>) Sort(Comparison<T>) Sort(Comparison<T>) Sort(Comparison<T>)

使用指定的 Comparison<T> 來排序整個陣列中項目。Sorts the elements in the entire array using the specified Comparison<T>.

Sort(IComparer<T>) Sort(IComparer<T>) Sort(IComparer<T>) Sort(IComparer<T>)

為陣列的內容排序。Sorts the contents of the array.

Sort(Int32, Int32, IComparer<T>) Sort(Int32, Int32, IComparer<T>) Sort(Int32, Int32, IComparer<T>) Sort(Int32, Int32, IComparer<T>)

為陣列的內容排序。Sorts the contents of the array.

ToArray() ToArray() ToArray() ToArray()

建立含有此 ImmutableArray<T>.Builder 目前內容的新陣列。Creates a new array with the current contents of this ImmutableArray<T>.Builder.

ToImmutable() ToImmutable() ToImmutable() ToImmutable()

傳回包含此 ImmutableArray<T>.Builder 目前內容的不可變陣列。Returns an immutable array that contains the current contents of this ImmutableArray<T>.Builder.

ToString() ToString() ToString() ToString()

傳回代表目前物件的字串。Returns a string that represents the current object.

(Inherited from Object)

明確介面實作

ICollection<T>.IsReadOnly ICollection<T>.IsReadOnly ICollection<T>.IsReadOnly ICollection<T>.IsReadOnly

取得值,這個值表示 ICollection<T> 是否為唯讀。Gets a value that indicates whether the ICollection<T> is read-only.

IEnumerable.GetEnumerator() IEnumerable.GetEnumerator() IEnumerable.GetEnumerator() IEnumerable.GetEnumerator()

傳回可逐一查看陣列的列舉程式。Returns an enumerator that iterates through the array.

IEnumerable<T>.GetEnumerator() IEnumerable<T>.GetEnumerator() IEnumerable<T>.GetEnumerator() IEnumerable<T>.GetEnumerator()

傳回可逐一查看陣列的列舉程式。Returns an enumerator that iterates through the array.

擴充方法

CopyToDataTable<T>(IEnumerable<T>) CopyToDataTable<T>(IEnumerable<T>) CopyToDataTable<T>(IEnumerable<T>) CopyToDataTable<T>(IEnumerable<T>)

根據輸入 DataTable 物件 (其中泛型參數 TDataRow) 傳回包含 IEnumerable<T> 物件複本的 DataRowReturns a DataTable that contains copies of the DataRow objects, given an input IEnumerable<T> object where the generic parameter T is DataRow.

CopyToDataTable<T>(IEnumerable<T>, DataTable, LoadOption) CopyToDataTable<T>(IEnumerable<T>, DataTable, LoadOption) CopyToDataTable<T>(IEnumerable<T>, DataTable, LoadOption) CopyToDataTable<T>(IEnumerable<T>, DataTable, LoadOption)

根據輸入 DataRow 物件 (其中泛型參數 TDataTable),將 IEnumerable<T> 物件複製到指定的 DataRowCopies DataRow objects to the specified DataTable, given an input IEnumerable<T> object where the generic parameter T is DataRow.

CopyToDataTable<T>(IEnumerable<T>, DataTable, LoadOption, FillErrorEventHandler) CopyToDataTable<T>(IEnumerable<T>, DataTable, LoadOption, FillErrorEventHandler) CopyToDataTable<T>(IEnumerable<T>, DataTable, LoadOption, FillErrorEventHandler) CopyToDataTable<T>(IEnumerable<T>, DataTable, LoadOption, FillErrorEventHandler)

根據輸入 DataRow 物件 (其中泛型參數 TDataTable),將 IEnumerable<T> 物件複製到指定的 DataRowCopies DataRow objects to the specified DataTable, given an input IEnumerable<T> object where the generic parameter T is DataRow.

Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable)

IEnumerable 的項目轉換成指定的型別。Casts the elements of an IEnumerable to the specified type.

OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable)

根據指定的型別來篩選 IEnumerable 的項目。Filters the elements of an IEnumerable based on a specified type.

Any<T>(ImmutableArray<T>) Any<T>(ImmutableArray<T>) Any<T>(ImmutableArray<T>) Any<T>(ImmutableArray<T>)

傳回值,該值指示此集合是否包含任何元素。Returns a value indicating whether this collection contains any elements.

First<T>(ImmutableArray<T>) First<T>(ImmutableArray<T>) First<T>(ImmutableArray<T>) First<T>(ImmutableArray<T>)

傳回集合中的第一個元素。Returns the first element in the collection.

FirstOrDefault<T>(ImmutableArray<T>) FirstOrDefault<T>(ImmutableArray<T>) FirstOrDefault<T>(ImmutableArray<T>) FirstOrDefault<T>(ImmutableArray<T>)

傳回集合中第一個元素,如果集合是空的則傳回預設值。Returns the first element in the collection, or the default value if the collection is empty.

Last<T>(ImmutableArray<T>) Last<T>(ImmutableArray<T>) Last<T>(ImmutableArray<T>) Last<T>(ImmutableArray<T>)

傳回集合中的最後一個元素。Returns the last element in the collection.

LastOrDefault<T>(ImmutableArray<T>) LastOrDefault<T>(ImmutableArray<T>) LastOrDefault<T>(ImmutableArray<T>) LastOrDefault<T>(ImmutableArray<T>)

傳回集合中最後一個元素,如果集合是空的則傳回預設值。Returns the last element in the collection, or the default value if the collection is empty.

AsParallel(IEnumerable) AsParallel(IEnumerable) AsParallel(IEnumerable) AsParallel(IEnumerable)

啟用查詢的平行化作業。Enables parallelization of a query.

AsQueryable(IEnumerable) AsQueryable(IEnumerable) AsQueryable(IEnumerable) AsQueryable(IEnumerable)

IEnumerable 轉換成 IQueryableConverts an IEnumerable to an IQueryable.

Ancestors<T>(IEnumerable<T>) Ancestors<T>(IEnumerable<T>) Ancestors<T>(IEnumerable<T>) Ancestors<T>(IEnumerable<T>)

傳回包含來源集合中每個節點祖系的項目集合。Returns a collection of elements that contains the ancestors of every node in the source collection.

Ancestors<T>(IEnumerable<T>, XName) Ancestors<T>(IEnumerable<T>, XName) Ancestors<T>(IEnumerable<T>, XName) Ancestors<T>(IEnumerable<T>, XName)

傳回包含來源集合中每個節點祖系的已篩選項目集合。Returns a filtered collection of elements that contains the ancestors of every node in the source collection. 集合中只會包含具有相符之 XName 的項目。Only elements that have a matching XName are included in the collection.

DescendantNodes<T>(IEnumerable<T>) DescendantNodes<T>(IEnumerable<T>) DescendantNodes<T>(IEnumerable<T>) DescendantNodes<T>(IEnumerable<T>)

傳回來源集合中每個文件和項目之子代節點的集合。Returns a collection of the descendant nodes of every document and element in the source collection.

Descendants<T>(IEnumerable<T>) Descendants<T>(IEnumerable<T>) Descendants<T>(IEnumerable<T>) Descendants<T>(IEnumerable<T>)

傳回包含來源集合中每個項目和文件之子代項目的項目集合。Returns a collection of elements that contains the descendant elements of every element and document in the source collection.

Descendants<T>(IEnumerable<T>, XName) Descendants<T>(IEnumerable<T>, XName) Descendants<T>(IEnumerable<T>, XName) Descendants<T>(IEnumerable<T>, XName)

傳回已篩選的項目集合,其中包含來源集合中每個項目和文件的子代項目。Returns a filtered collection of elements that contains the descendant elements of every element and document in the source collection. 集合中只會包含具有相符之 XName 的項目。Only elements that have a matching XName are included in the collection.

Elements<T>(IEnumerable<T>) Elements<T>(IEnumerable<T>) Elements<T>(IEnumerable<T>) Elements<T>(IEnumerable<T>)

傳回來源集合中每個項目和文件的子項目集合。Returns a collection of the child elements of every element and document in the source collection.

Elements<T>(IEnumerable<T>, XName) Elements<T>(IEnumerable<T>, XName) Elements<T>(IEnumerable<T>, XName) Elements<T>(IEnumerable<T>, XName)

傳回來源集合中每個項目和文件的已篩選子項目集合。Returns a filtered collection of the child elements of every element and document in the source collection. 集合中只會包含具有相符之 XName 的項目。Only elements that have a matching XName are included in the collection.

InDocumentOrder<T>(IEnumerable<T>) InDocumentOrder<T>(IEnumerable<T>) InDocumentOrder<T>(IEnumerable<T>) InDocumentOrder<T>(IEnumerable<T>)

傳回包含來源集合中所有節點的節點集合,依據文件順序來排序。Returns a collection of nodes that contains all nodes in the source collection, sorted in document order.

Nodes<T>(IEnumerable<T>) Nodes<T>(IEnumerable<T>) Nodes<T>(IEnumerable<T>) Nodes<T>(IEnumerable<T>)

傳回來源集合中每個文件和項目的子節點集合。Returns a collection of the child nodes of every document and element in the source collection.

Remove<T>(IEnumerable<T>) Remove<T>(IEnumerable<T>) Remove<T>(IEnumerable<T>) Remove<T>(IEnumerable<T>)

在來源集合中,從每一個節點的父節點移除這些節點。Removes every node in the source collection from its parent node.

適用於