ImmutableArrayExtensions Class

Definition

LINQ 扩展方法重写,它们为 ImmutableArray<T> 提供的效率高于标准 LINQ 方法。LINQ extension method overrides that offer greater efficiency for ImmutableArray<T> than the standard LINQ methods NuGet package: System.Collections.Immutable关于不可变集合和安装方法NuGet package: System.Collections.Immutable (about immutable collections and how to install)

public ref class ImmutableArrayExtensions abstract sealed
public static class ImmutableArrayExtensions
type ImmutableArrayExtensions = class
Public Module ImmutableArrayExtensions
Inheritance
ImmutableArrayExtensions

Methods

Aggregate<T>(ImmutableArray<T>, Func<T,T,T>)

以累加方式向元素序列应用函数。Applies a function to a sequence of elements in a cumulative way.

Aggregate<TAccumulate,T>(ImmutableArray<T>, TAccumulate, Func<TAccumulate,T,TAccumulate>)

以累加方式向元素序列应用函数。Applies a function to a sequence of elements in a cumulative way.

Aggregate<TAccumulate,TResult,T>(ImmutableArray<T>, TAccumulate, Func<TAccumulate,T,TAccumulate>, Func<TAccumulate,TResult>)

以累加方式向元素序列应用函数。Applies a function to a sequence of elements in a cumulative way.

All<T>(ImmutableArray<T>, Func<T,Boolean>)

获取一个值,该值指示此数组中的所有元素是否与给定的条件匹配。Gets a value indicating whether all elements in this array match a given condition.

Any<T>(ImmutableArray<T>)

获取一个值,该值指示数组是否包含任何元素。Gets a value indicating whether the array contains any elements.

Any<T>(ImmutableArray<T>, Func<T,Boolean>)

获取一个值,该值指示数组是否包含与指定条件匹配的任何元素。Gets a value indicating whether the array contains any elements that match a specified condition.

Any<T>(ImmutableArray<T>.Builder)

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

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

返回数组中指定索引处的元素。Returns the element at a specified index in the array.

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

返回序列中指定索引处的元素;如果索引超出范围,则返回默认值。Returns the element at a specified index in a sequence or a default value if the index is out of range.

First<T>(ImmutableArray<T>)

返回数组中的第一个元素。Returns the first element in an array.

First<T>(ImmutableArray<T>, Func<T,Boolean>)

返回序列中满足指定条件的第一个元素。Returns the first element in a sequence that satisfies a specified condition.

First<T>(ImmutableArray<T>.Builder)

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

FirstOrDefault<T>(ImmutableArray<T>)

返回序列中的第一个元素;如果序列中不包含任何元素,则返回默认值。Returns the first element of a sequence, or a default value if the sequence contains no elements.

FirstOrDefault<T>(ImmutableArray<T>, Func<T,Boolean>)

返回序列中满足条件的第一个元素;如果未找到这样的元素,则返回默认值。Returns the first element of the sequence that satisfies a condition or a default value if no such element is found.

FirstOrDefault<T>(ImmutableArray<T>.Builder)

返回集合中的第一个元素;如果集合为空,则返回默认值。Returns the first element in the collection, or the default value if the collection is empty.

Last<T>(ImmutableArray<T>)

返回数组的最后一个元素。Returns the last element of the array.

Last<T>(ImmutableArray<T>, Func<T,Boolean>)

返回序列中满足指定条件的最后一个元素。Returns the last element of a sequence that satisfies a specified condition.

Last<T>(ImmutableArray<T>.Builder)

返回集合中的最后一个元素。Returns the last element in the collection.

LastOrDefault<T>(ImmutableArray<T>)

返回序列中的最后一个元素;如果序列中不包含任何元素,则返回默认值。Returns the last element of a sequence, or a default value if the sequence contains no elements.

LastOrDefault<T>(ImmutableArray<T>, Func<T,Boolean>)

返回序列中满足条件的最后一个元素;如果未找到这样的元素,则返回默认值。Returns the last element of a sequence that satisfies a condition or a default value if no such element is found.

LastOrDefault<T>(ImmutableArray<T>.Builder)

返回集合中的最后一个元素;如果集合为空,则返回默认值。Returns the last element in the collection, or the default value if the collection is empty.

Select<T,TResult>(ImmutableArray<T>, Func<T,TResult>)

将序列中的每个元素投影到新表单。Projects each element of a sequence into a new form.

SelectMany<TSource,TCollection,TResult>(ImmutableArray<TSource>, Func<TSource,IEnumerable<TCollection>>, Func<TSource,TCollection,TResult>)

将序列的每个元素投影到 IEnumerable<T>,并将结果序列合并为一个序列,并对其中每个元素调用结果选择器函数。Projects each element of a sequence to an IEnumerable<T>, flattens the resulting sequences into one sequence, and invokes a result selector function on each element therein.

SequenceEqual<TDerived,TBase>(ImmutableArray<TBase>, IEnumerable<TDerived>, IEqualityComparer<TBase>)

根据相等比较器确定两个序列是否相等。Determines whether two sequences are equal according to an equality comparer.

SequenceEqual<TDerived,TBase>(ImmutableArray<TBase>, ImmutableArray<TDerived>, Func<TBase,TBase,Boolean>)

根据相等比较器确定两个序列是否相等。Determines whether two sequences are equal according to an equality comparer.

SequenceEqual<TDerived,TBase>(ImmutableArray<TBase>, ImmutableArray<TDerived>, IEqualityComparer<TBase>)

根据相等比较器确定两个序列是否相等。Determines whether two sequences are equal according to an equality comparer.

Single<T>(ImmutableArray<T>)

返回序列的唯一元素;如果该序列并非恰好包含一个元素,则会引发异常。Returns the only element of a sequence, and throws an exception if there is not exactly one element in the sequence.

Single<T>(ImmutableArray<T>, Func<T,Boolean>)

返回序列中满足指定条件的唯一元素;如果有多个这样的元素存在,则会引发异常。Returns the only element of a sequence that satisfies a specified condition, and throws an exception if more than one such element exists.

SingleOrDefault<T>(ImmutableArray<T>)

返回数组中的唯一元素;如果序列为空,则返回默认值;如果序列包含多个元素,此方法将引发异常。Returns the only element of the array, or a default value if the sequence is empty; this method throws an exception if there is more than one element in the sequence.

SingleOrDefault<T>(ImmutableArray<T>, Func<T,Boolean>)

返回序列中满足指定条件的唯一元素;如果这类元素不存在,则返回默认值;如果有多个元素满足该条件,此方法将引发异常。Returns the only element of a sequence that satisfies a specified condition or a default value if no such element exists; this method throws an exception if more than one element satisfies the condition.

ToArray<T>(ImmutableArray<T>)

将此数组的内容复制到不可变数组。Copies the contents of this array to a mutable array.

ToDictionary<TKey,T>(ImmutableArray<T>, Func<T,TKey>)

基于此数组的内容创建字典。Creates a dictionary based on the contents of this array.

ToDictionary<TKey,T>(ImmutableArray<T>, Func<T,TKey>, IEqualityComparer<TKey>)

基于此数组的内容创建字典。Creates a dictionary based on the contents of this array.

ToDictionary<TKey,TElement,T>(ImmutableArray<T>, Func<T,TKey>, Func<T,TElement>)

基于此数组的内容创建字典。Creates a dictionary based on the contents of this array.

ToDictionary<TKey,TElement,T>(ImmutableArray<T>, Func<T,TKey>, Func<T,TElement>, IEqualityComparer<TKey>)

基于此数组的内容创建字典。Creates a dictionary based on the contents of this array.

Where<T>(ImmutableArray<T>, Func<T,Boolean>)

基于谓词筛选值序列。Filters a sequence of values based on a predicate.

Applies to