ImmutableList<T>.Builder Class

 

Represents a list that mutates with little or no memory allocations and that can produce or build on immutable list instances very efficiently.

NuGet package: System.Collections.Immutable (about immutable collections and how to install)

Namespace:   System.Collections.Immutable
Assembly:  System.Collections.Immutable (in System.Collections.Immutable.dll)

System.Object
  System.Collections.Immutable.ImmutableList<T>.Builder

[DefaultMemberAttribute("Item")]
[DebuggerDisplayAttribute("Count = {Count}")]
public sealed class Builder : IList<T>, ICollection<T>, IEnumerable<T>, 
	IEnumerable, IList, ICollection, IReadOnlyList<T>, IReadOnlyCollection<T>

NameDescription
System_CAPS_pubpropertyCount

Gets the number of elements in this immutable list.

System_CAPS_pubpropertyItem[Int32]

Gets or sets the value for a given index in the list.

NameDescription
System_CAPS_pubmethodAdd(T)

Adds an item to the immutable list.

System_CAPS_pubmethodAddRange(IEnumerable<T>)

Adds a series of elements to the end of this list.

System_CAPS_pubmethodBinarySearch(T)

Searches the entire ImmutableList<T>.Builder for an element using the default comparer and returns the zero-based index of the element.

System_CAPS_pubmethodBinarySearch(T, IComparer<T>)

Searches the entire ImmutableList<T>.Builder for an element using the specified comparer and returns the zero-based index of the element.

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

Searches the specified range of the ImmutableList<T>.Builder for an element using the specified comparer and returns the zero-based index of the element.

System_CAPS_pubmethodClear()

Removes all items from the immutable list.

System_CAPS_pubmethodContains(T)

Determines whether the immutable list contains a specific value.

System_CAPS_pubmethodConvertAll<TOutput>(Func<T, TOutput>)

Creates a new immutable list from the list represented by this builder by using the converter function.

System_CAPS_pubmethodCopyTo(T[])

Copies the entire immutable list to a compatible one-dimensional array, starting at the beginning of the target array.

System_CAPS_pubmethodCopyTo(T[], Int32)

Copies the entire immutable list to a compatible one-dimensional array, starting at the specified index of the target array.

System_CAPS_pubmethodCopyTo(Int32, T[], Int32, Int32)

Copies the entire immutable list to a compatible one-dimensional array, starting at the specified index of the target array.

System_CAPS_pubmethodEquals(Object)

(Inherited from Object.)

System_CAPS_pubmethodExists(Predicate<T>)

Determines whether the immutable list contains elements that match the conditions defined by the specified predicate.

System_CAPS_pubmethodFind(Predicate<T>)

Searches for an element that matches the conditions defined by the specified predicate, and returns the first occurrence within the entire immutable list.

System_CAPS_pubmethodFindAll(Predicate<T>)

Retrieves all the elements that match the conditions defined by the specified predicate.

System_CAPS_pubmethodFindIndex(Int32, Int32, Predicate<T>)

Searches for an element that matches the conditions defined by the specified predicate, and returns the zero-based index of the first occurrence within the range of elements in the immutable list that starts at the specified index and contains the specified number of elements.

System_CAPS_pubmethodFindIndex(Int32, Predicate<T>)

Searches for an element that matches the conditions defined by the specified predicate, and returns the zero-based index of the first occurrence within the range of elements in the immutable list that extends from the specified index to the last element.

System_CAPS_pubmethodFindIndex(Predicate<T>)

Searches for an element that matches the conditions defined by the specified predicate, and returns the zero-based index of the first occurrence within the entire immutable list.

System_CAPS_pubmethodFindLast(Predicate<T>)

Searches for an element that matches the conditions defined by the specified predicate, and returns the last occurrence within the entire immutable list.

System_CAPS_pubmethodFindLastIndex(Int32, Int32, Predicate<T>)

Searches for an element that matches the conditions defined by the specified predicate, and returns the zero-based index of the last occurrence within the range of elements in the immutable list that contains the specified number of elements and ends at the specified index.

System_CAPS_pubmethodFindLastIndex(Int32, Predicate<T>)

Searches for an element that matches the conditions defined by the specified predicate, and returns the zero-based index of the last occurrence within the range of elements in the immutable list that extends from the first element to the specified index.

System_CAPS_pubmethodFindLastIndex(Predicate<T>)

Searches for an element that matches the conditions defined by the specified predicate, and returns the zero-based index of the last occurrence within the entire immutable list.

System_CAPS_pubmethodForEach(Action<T>)

Performs the specified action on each element of the list.

System_CAPS_pubmethodGetEnumerator()

Returns an enumerator that iterates through the collection.

System_CAPS_pubmethodGetHashCode()

(Inherited from Object.)

System_CAPS_pubmethodGetRange(Int32, Int32)

Creates a shallow copy of a range of elements in the source immutable list.

System_CAPS_pubmethodGetType()

(Inherited from Object.)

System_CAPS_pubmethodIndexOf(T)

Searches for the specified object and returns the zero-based index of the first occurrence within the range of elements in the immutable list.

System_CAPS_pubmethodIndexOf(T, Int32)

Searches for the specified object and returns the zero-based index of the first occurrence within the range of elements in the immutable list that extends from the specified index to the last element.

System_CAPS_pubmethodIndexOf(T, Int32, Int32)

Searches for the specified object and returns the zero-based index of the first occurrence within the range of elements in the immutable list that starts at the specified index and contains the specified number of elements.

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

Searches for the specified object and returns the zero-based index of the first occurrence within the range of elements in the ImmutableList<T>.Builder that starts at the specified index and contains the specified number of elements.

System_CAPS_pubmethodInsert(Int32, T)

Inserts an item to the immutable list at the specified index.

System_CAPS_pubmethodInsertRange(Int32, IEnumerable<T>)

Inserts the elements of a collection into the immutable list at the specified index.

System_CAPS_pubmethodLastIndexOf(T)

Searches for the specified object and returns the zero-based index of the last occurrence within the entire immutable list.

System_CAPS_pubmethodLastIndexOf(T, Int32)

Searches for the specified object and returns the zero-based index of the last occurrence within the range of elements in the immutable list that extends from the first element to the specified index.

System_CAPS_pubmethodLastIndexOf(T, Int32, Int32)

Searches for the specified object and returns the zero-based index of the last occurrence within the range of elements in the immutable list that contains the specified number of elements and ends at the specified index.

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

Searches for the specified object and returns the zero-based index of the last occurrence within the range of elements in the immutable list that contains the specified number of elements and ends at the specified index.

System_CAPS_pubmethodRemove(T)

Removes the first occurrence of a specific object from the immutable list.

System_CAPS_pubmethodRemoveAll(Predicate<T>)

Removes all the elements that match the conditions defined by the specified predicate.

System_CAPS_pubmethodRemoveAt(Int32)

Removes the item at the specified index of the immutable list.

System_CAPS_pubmethodReverse()

Reverses the order of the elements in the entire immutable list.

System_CAPS_pubmethodReverse(Int32, Int32)

Reverses the order of the elements in the specified range of the immutable list.

System_CAPS_pubmethodSort()

Sorts the elements in the entire immutable list by using the default comparer.

System_CAPS_pubmethodSort(Comparison<T>)

Sorts the elements in the entire immutable list by using the specified comparison object.

System_CAPS_pubmethodSort(IComparer<T>)

Sorts the elements in the entire immutable list by using the specified comparer.

System_CAPS_pubmethodSort(Int32, Int32, IComparer<T>)

Sorts the elements in a range of elements in the immutable list by using the specified comparer.

System_CAPS_pubmethodToImmutable()

Creates an immutable list based on the contents of this instance.

System_CAPS_pubmethodToString()

(Inherited from Object.)

System_CAPS_pubmethodTrueForAll(Predicate<T>)

Determines whether every element in the immutable list matches the conditions defined by the specified predicate.

NameDescription
System_CAPS_pubinterfaceSystem_CAPS_privmethodIEnumerable<T>.GetEnumerator()

Returns an enumerator that iterates through the collection.

System_CAPS_pubinterfaceSystem_CAPS_privmethodICollection.CopyTo(Array, Int32)

Copies the elements of the list to an array, starting at a particular array index.

System_CAPS_pubinterfaceSystem_CAPS_privmethodIEnumerable.GetEnumerator()

Returns an enumerator that iterates through the collection.

System_CAPS_pubinterfaceSystem_CAPS_privmethodIList.Add(Object)

Adds an item to the list.

System_CAPS_pubinterfaceSystem_CAPS_privmethodIList.Clear()

Removes all items from the list.

System_CAPS_pubinterfaceSystem_CAPS_privmethodIList.Contains(Object)

Determines whether the list contains a specific value.

System_CAPS_pubinterfaceSystem_CAPS_privmethodIList.IndexOf(Object)

Determines the index of a specific item in the list.

System_CAPS_pubinterfaceSystem_CAPS_privmethodIList.Insert(Int32, Object)

Inserts an item to the list at the specified index.

System_CAPS_pubinterfaceSystem_CAPS_privmethodIList.Remove(Object)

Removes the first occurrence of a specific object from the list.

System_CAPS_pubinterfaceSystem_CAPS_privpropertyICollection<T>.IsReadOnly

Gets a value indicating whether this instance is read-only.

System_CAPS_pubinterfaceSystem_CAPS_privpropertyICollection.IsSynchronized

Gets a value indicating whether access to the ICollection is synchronized (thread safe).

System_CAPS_pubinterfaceSystem_CAPS_privpropertyICollection.SyncRoot

Gets an object that can be used to synchronize access to the ICollection.

System_CAPS_pubinterfaceSystem_CAPS_privpropertyIList.IsFixedSize

Gets a value indicating whether the IList has a fixed size.

System_CAPS_pubinterfaceSystem_CAPS_privpropertyIList.IsReadOnly

Gets a value indicating whether the ICollection<T> is read-only.

System_CAPS_pubinterfaceSystem_CAPS_privpropertyIList.Item[Int32]

Gets or sets the Object at the specified index.

NameDescription
System_CAPS_pubmethodToImmutableArray<T>()

Creates an immutable array from the specified collection.(Defined by ImmutableArray.)

System_CAPS_pubmethodToImmutableDictionary<T, TKey>(Func<T, TKey>)

Overloaded. Constructs an immutable dictionary from an existing collection of elements, applying a transformation function to the source keys.(Defined by ImmutableDictionary.)

System_CAPS_pubmethodToImmutableDictionary<T, TKey>(Func<T, TKey>, IEqualityComparer<TKey>)

Overloaded. Constructs an immutable dictionary based on some transformation of a sequence.(Defined by ImmutableDictionary.)

System_CAPS_pubmethodToImmutableDictionary<T, TKey, TValue>(Func<T, TKey>, Func<T, TValue>)

Overloaded. Enumerates and transforms a sequence, and produces an immutable dictionary of its contents.(Defined by ImmutableDictionary.)

System_CAPS_pubmethodToImmutableDictionary<T, TKey, TValue>(Func<T, TKey>, Func<T, TValue>, IEqualityComparer<TKey>)

Overloaded. Enumerates and transforms a sequence, and produces an immutable dictionary of its contents by using the specified key comparer.(Defined by ImmutableDictionary.)

System_CAPS_pubmethodToImmutableDictionary<T, TKey, TValue>(Func<T, TKey>, Func<T, TValue>, IEqualityComparer<TKey>, IEqualityComparer<TValue>)

Overloaded. Enumerates and transforms a sequence, and produces an immutable dictionary of its contents by using the specified key and value comparers.(Defined by ImmutableDictionary.)

System_CAPS_pubmethodToImmutableHashSet<T>()

Overloaded. Enumerates a sequence and produces an immutable hash set of its contents.(Defined by ImmutableHashSet.)

System_CAPS_pubmethodToImmutableHashSet<T>(IEqualityComparer<T>)

Overloaded. Enumerates a sequence, produces an immutable hash set of its contents, and uses the specified equality comparer for the set type.(Defined by ImmutableHashSet.)

System_CAPS_pubmethodToImmutableList<T>()

Enumerates a sequence and produces an immutable list of its contents.(Defined by ImmutableList.)

System_CAPS_pubmethodToImmutableSortedDictionary<T, TKey, TValue>(Func<T, TKey>, Func<T, TValue>)

Overloaded. Enumerates and transforms a sequence, and produces an immutable sorted dictionary of its contents.(Defined by ImmutableSortedDictionary.)

System_CAPS_pubmethodToImmutableSortedDictionary<T, TKey, TValue>(Func<T, TKey>, Func<T, TValue>, IComparer<TKey>)

Overloaded. Enumerates and transforms a sequence, and produces an immutable sorted dictionary of its contents by using the specified key comparer.(Defined by ImmutableSortedDictionary.)

System_CAPS_pubmethodToImmutableSortedDictionary<T, TKey, TValue>(Func<T, TKey>, Func<T, TValue>, IComparer<TKey>, IEqualityComparer<TValue>)

Overloaded. Enumerates and transforms a sequence, and produces an immutable sorted dictionary of its contents by using the specified key and value comparers.(Defined by ImmutableSortedDictionary.)

System_CAPS_pubmethodToImmutableSortedSet<T>()

Overloaded. Enumerates a sequence and produces an immutable sorted set of its contents.(Defined by ImmutableSortedSet.)

System_CAPS_pubmethodToImmutableSortedSet<T>(IComparer<T>)

Overloaded. Enumerates a sequence, produces an immutable sorted set of its contents, and uses the specified comparer.(Defined by ImmutableSortedSet.)

Although ImmutableList<T>.AddRange and other methods already provide fast bulk change operations on the list, the ImmutableList<T>.Builder class allows multiple combinations of changes to be made to a list with equal efficiency.

Any public static ( Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
Show: