Editar

Compartir a través de


ImmutableArrayExtensions.Aggregate Method

Definition

Overloads

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.

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

Source:
ImmutableArrayExtensions.cs
Source:
ImmutableArrayExtensions.cs
Source:
ImmutableArrayExtensions.cs
Source:
ImmutableArrayExtensions.cs

Applies a function to a sequence of elements in a cumulative way.

public:
generic <typename T>
[System::Runtime::CompilerServices::Extension]
 static T Aggregate(System::Collections::Immutable::ImmutableArray<T> immutableArray, Func<T, T, T> ^ func);
public static T Aggregate<T> (this System.Collections.Immutable.ImmutableArray<T> immutableArray, Func<T,T,T> func);
public static T? Aggregate<T> (this System.Collections.Immutable.ImmutableArray<T> immutableArray, Func<T,T,T> func);
static member Aggregate : System.Collections.Immutable.ImmutableArray<'T> * Func<'T, 'T, 'T> -> 'T
<Extension()>
Public Function Aggregate(Of T) (immutableArray As ImmutableArray(Of T), func As Func(Of T, T, T)) As T

Type Parameters

T

The type of element contained by the collection.

Parameters

immutableArray
ImmutableArray<T>

The collection to apply the function to.

func
Func<T,T,T>

A function to be invoked on each element, in a cumulative way.

Returns

T

The final value after the cumulative function has been applied to all elements.

Remarks

Aggregate method makes it simple to perform a calculation over a sequence of values. This method works by calling func one time for each element in source. Each time func is called, Aggregate passes both the element from the sequence and an aggregated value (as the first argument to func). The value of the seed parameter is used as the initial aggregate value. The result of func replaces the previous aggregated value. Aggregate returns the final result of func.

Applies to

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

Source:
ImmutableArrayExtensions.cs
Source:
ImmutableArrayExtensions.cs
Source:
ImmutableArrayExtensions.cs
Source:
ImmutableArrayExtensions.cs

Applies a function to a sequence of elements in a cumulative way.

public:
generic <typename TAccumulate, typename T>
[System::Runtime::CompilerServices::Extension]
 static TAccumulate Aggregate(System::Collections::Immutable::ImmutableArray<T> immutableArray, TAccumulate seed, Func<TAccumulate, T, TAccumulate> ^ func);
public static TAccumulate Aggregate<TAccumulate,T> (this System.Collections.Immutable.ImmutableArray<T> immutableArray, TAccumulate seed, Func<TAccumulate,T,TAccumulate> func);
static member Aggregate : System.Collections.Immutable.ImmutableArray<'T> * 'Accumulate * Func<'Accumulate, 'T, 'Accumulate> -> 'Accumulate
<Extension()>
Public Function Aggregate(Of TAccumulate, T) (immutableArray As ImmutableArray(Of T), seed As TAccumulate, func As Func(Of TAccumulate, T, TAccumulate)) As TAccumulate

Type Parameters

TAccumulate

The type of the accumulated value.

T

The type of element contained by the collection.

Parameters

immutableArray
ImmutableArray<T>

The collection to apply the function to.

seed
TAccumulate

The initial accumulator value.

func
Func<TAccumulate,T,TAccumulate>

A function to be invoked on each element, in a cumulative way.

Returns

TAccumulate

The final accumulator value.

Remarks

Aggregate method makes it simple to perform a calculation over a sequence of values. This method works by calling func one time for each element in source. Each time func is called, Aggregate passes both the element from the sequence and an aggregated value (as the first argument to func). The value of the seed parameter is used as the initial aggregate value. The result of func replaces the previous aggregated value. Aggregate returns the final result of func.

Applies to

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

Source:
ImmutableArrayExtensions.cs
Source:
ImmutableArrayExtensions.cs
Source:
ImmutableArrayExtensions.cs
Source:
ImmutableArrayExtensions.cs

Applies a function to a sequence of elements in a cumulative way.

public:
generic <typename TAccumulate, typename TResult, typename T>
[System::Runtime::CompilerServices::Extension]
 static TResult Aggregate(System::Collections::Immutable::ImmutableArray<T> immutableArray, TAccumulate seed, Func<TAccumulate, T, TAccumulate> ^ func, Func<TAccumulate, TResult> ^ resultSelector);
public static TResult Aggregate<TAccumulate,TResult,T> (this System.Collections.Immutable.ImmutableArray<T> immutableArray, TAccumulate seed, Func<TAccumulate,T,TAccumulate> func, Func<TAccumulate,TResult> resultSelector);
static member Aggregate : System.Collections.Immutable.ImmutableArray<'T> * 'Accumulate * Func<'Accumulate, 'T, 'Accumulate> * Func<'Accumulate, 'Result> -> 'Result
<Extension()>
Public Function Aggregate(Of TAccumulate, TResult, T) (immutableArray As ImmutableArray(Of T), seed As TAccumulate, func As Func(Of TAccumulate, T, TAccumulate), resultSelector As Func(Of TAccumulate, TResult)) As TResult

Type Parameters

TAccumulate

The type of the accumulated value.

TResult

The type of result returned by the result selector.

T

The type of element contained by the collection.

Parameters

immutableArray
ImmutableArray<T>

The collection to apply the function to.

seed
TAccumulate

The initial accumulator value.

func
Func<TAccumulate,T,TAccumulate>

A function to be invoked on each element, in a cumulative way.

resultSelector
Func<TAccumulate,TResult>

A function to transform the final accumulator value into the result type.

Returns

TResult

The final accumulator value.

Remarks

Aggregate method makes it simple to perform a calculation over a sequence of values. This method works by calling func one time for each element in source. Each time func is called, Aggregate passes both the element from the sequence and an aggregated value (as the first argument to func). The value of the seed parameter is used as the initial aggregate value. The result of func replaces the previous aggregated value. Aggregate returns the final result of func.

Applies to