Table of Contents

Method Slice

Namespace
SodaFlow.Collections
Assembly
SodaFlow.Collections.dll

Slice<TKey, TIdentity, TState>(ReactiveCollection<TKey, TIdentity, TState>, int, int)

limit keys of the upstream that start at offset, which are a page of the order and the filter above this stage.

public static ReactiveCollection<TKey, TIdentity, TState> Slice<TKey, TIdentity, TState>(this ReactiveCollection<TKey, TIdentity, TState> upstream, int offset, int limit) where TKey : notnull where TIdentity : notnull

Parameters

upstream ReactiveCollection<TKey, TIdentity, TState>

The collection or view to window.

offset int

The number of keys before the start of the window.

limit int

How many keys to keep.

Returns

ReactiveCollection<TKey, TIdentity, TState>

A view of that window.

Type Parameters

TKey

The type of the keys.

TIdentity

The type of the immutable part of an item.

TState

The type of the mutable part of an item.

Remarks

There is no Skip for a pair with Take, for this cause. A window with the two ends has a limit, thus this stage stays O(limit) for each transaction. A skip alone gives a view whose size follows the collection. A page also needs the two ends.

Slice<TKey, TIdentity, TState>(ReactiveCollection<TKey, TIdentity, TState>, Cell<int>, Cell<int>)

A page of the upstream where each end can change. Send a new offset to move to a different page.

public static ReactiveCollection<TKey, TIdentity, TState> Slice<TKey, TIdentity, TState>(this ReactiveCollection<TKey, TIdentity, TState> upstream, Cell<int> offsetCell, Cell<int> limitCell) where TKey : notnull where TIdentity : notnull

Parameters

upstream ReactiveCollection<TKey, TIdentity, TState>

The collection or view to window.

offsetCell Cell<int>

The number of keys before the start of the window.

limitCell Cell<int>

How many keys to keep.

Returns

ReactiveCollection<TKey, TIdentity, TState>

A view of that window.

Type Parameters

TKey

The type of the keys.

TIdentity

The type of the immutable part of an item.

TState

The type of the mutable part of an item.