Class KeySortedContext<T, TKey>

A class for helping in complex sorting patterns using a key selector.

Type Parameters

Hierarchy

Constructors

  • Constructs a KeySortedContext.

    Type Parameters

    Parameters

    • next: null | Comparer<T>

      If provided (not null) any items that are considered equal will use this comparer to decided their order.

    • keySelector: null | Selector<T, TKey>

      If provided (not null) will use the selected keys to order the results.

    • order: Order = Order.Ascending

      Ascending or Descending.

    • comparer: Comparison<T> = compare

      The comparison function. The default handles most cases.

    Returns KeySortedContext<T, TKey>

Properties

_comparer: Comparison<T>

The comparison function that will differentiate between items.

_keySelector: null | Selector<T, TKey>
_next: null | Comparer<T>

If provided (not null) any items that are considered equal will use this comparer to decided their order.

_order: Order = Order.Ascending

Ascending or Descending.

Accessors

Methods

  • Generates an array of indexes from the source in order of their expected internalSort without modifying the source.

    Returns

    Parameters

    • source: T[]

    Returns number[]

Generated using TypeDoc