Class Bucketizer
Contains extension methods for creating bucketizers.
Namespace: NanoByte.Common.Dispatch
Assembly: NanoByte.Common.dll
Syntax
public static class Bucketizer : Object
Methods
Bucketize<T>(IEnumerable<T>)
Creates a new predicate-matching bucketizer.
Declaration
public static Bucketizer<T> Bucketize<T>(this IEnumerable<T> elements)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<T> | elements | The elements to be bucketized. |
Returns
Type | Description |
---|---|
Bucketizer<T> |
Type Parameters
Name | Description |
---|---|
T |
Bucketize<TElement, TValue>(IEnumerable<TElement>, Func<TElement, TValue>)
Creates a new value-mapping bucketizer.
Declaration
public static Bucketizer<TElement, TValue> Bucketize<TElement, TValue>(this IEnumerable<TElement> elements, Func<TElement, TValue> valueRetriever)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<TElement> | elements | The elements to be bucketized. |
Func<TElement, TValue> | valueRetriever | A function to map elements to their according values used for bucketization. |
Returns
Type | Description |
---|---|
Bucketizer<TElement, TValue> |
Type Parameters
Name | Description |
---|---|
TElement | |
TValue |