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

Definition

A writable array accessor that can be converted into an ImmutableArray<T> instance without allocating extra memory.

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)

Type Parameters

T
Inheritance
ImmutableArray<T>.BuilderImmutableArray<T>.BuilderImmutableArray<T>.BuilderImmutableArray<T>.Builder
Implements

Properties

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.

Methods

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()

Gets 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)

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)

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)

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>)

Determines the 0-based index of the last occurrence of the specified item in this array.

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

Creates a shallow copy of the current Object.

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

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>)

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()

Creates a new array with the current contents of this ImmutableArray<T>.Builder.

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

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)

Explicit Interface Implementations

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

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.

Extension Methods

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

Returns 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)

Copies 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)

Copies 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)

Casts the elements of an IEnumerable to the specified type.

OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable) OfType<TResult>(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)

Converts 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. 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. 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. 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.

Applies to