Table of Contents

Class Bucketizer

Namespace
NanoByte.Common.Dispatch
Assembly
NanoByte.Common.dll

Contains extension methods for creating bucketizers.

public static class Bucketizer
Inheritance
object
Bucketizer

Methods

Bucketize<T>(IEnumerable<T>)

Creates a new predicate-matching bucketizer.

public static Bucketizer<T> Bucketize<T>(this IEnumerable<T> elements)

Parameters

elements IEnumerable<T>

The elements to be bucketized.

Returns

Bucketizer<T>

Type Parameters

T

Bucketize<TElement, TValue>(IEnumerable<TElement>, Func<TElement, TValue>)

Creates a new value-mapping bucketizer.

public static Bucketizer<TElement, TValue> Bucketize<TElement, TValue>(this IEnumerable<TElement> elements, Func<TElement, TValue> valueRetriever)

Parameters

elements IEnumerable<TElement>

The elements to be bucketized.

valueRetriever Func<TElement, TValue>

A function to map elements to their according values used for bucketization.

Returns

Bucketizer<TElement, TValue>

Type Parameters

TElement
TValue