Show / Hide Table of Contents

Class LazyBalancingOnRemoveStrategy<T, TChunk>

Denotes a base class for lazy balancing strategies for chunks

Inheritance
object
LazyBalancingOnRemoveStrategy<T, TChunk>
Implements
IChunkBalancingStrategyProvider<T, TChunk>
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: NMF.Expressions.Linq
Assembly: NMF.Expressions.Chunk.dll
Syntax
public class LazyBalancingOnRemoveStrategy<T, TChunk> : IChunkBalancingStrategyProvider<T, TChunk>
Type Parameters
Name Description
T

The type of elements

TChunk

The type of chunks

Fields

| Edit this page View Source

Default

Denotes the default lazy balancing strategy

Declaration
public static readonly LazyBalancingOnRemoveStrategy<T, TChunk> Default
Field Value
Type Description
LazyBalancingOnRemoveStrategy<T, TChunk>

Properties

| Edit this page View Source

RemoveFromOriginal

Determines whether the items shall be removed from their original chunk

Declaration
protected virtual bool RemoveFromOriginal { get; }
Property Value
Type Description
bool

Methods

| Edit this page View Source

CanAdjust(TChunk)

Determines whether the given chunk can be adjusted

Declaration
protected virtual bool CanAdjust(TChunk chunk)
Parameters
Type Name Description
TChunk chunk

The chunk to adjust

Returns
Type Description
bool

True, if the chunk can be modified, otherwise False

| Edit this page View Source

CanMove(TChunk, TChunk)

Determines whether elements can be moved between the given chunks

Declaration
protected virtual bool CanMove(TChunk sourceChunk, TChunk targetChunk)
Parameters
Type Name Description
TChunk sourceChunk

The source chunk

TChunk targetChunk

The target chunk

Returns
Type Description
bool

True, if moves are allowed, otherwise False

| Edit this page View Source

CreateStrategy(IObservableChunk<T, TChunk>)

Create a strategy for the given observable chunk collection

Declaration
public IChunkBalancingStrategy<T, TChunk> CreateStrategy(IObservableChunk<T, TChunk> observableChunk)
Parameters
Type Name Description
IObservableChunk<T, TChunk> observableChunk

The observable chunk collection

Returns
Type Description
IChunkBalancingStrategy<T, TChunk>

A chunk balancing strategy

| Edit this page View Source

GetChunkToRemove(IObservableChunk<T, TChunk>, int)

Gets the index of a chunk that can be targeted to remove

Declaration
protected virtual int GetChunkToRemove(IObservableChunk<T, TChunk> observable, int chunkStartIndex)
Parameters
Type Name Description
IObservableChunk<T, TChunk> observable

The observable chunk collection

int chunkStartIndex

The start chunk index to look from

Returns
Type Description
int

The index of a chunk that could be targeted to save

| Edit this page View Source

Move(int, List<int>, IObservableChunk<T, TChunk>)

Moves the given element from one chunk to the other

Declaration
protected virtual void Move(int sourceChunk, List<int> targetChunks, IObservableChunk<T, TChunk> observable)
Parameters
Type Name Description
int sourceChunk

The index of the source chunk

List<int> targetChunks

The index of the target chunk

IObservableChunk<T, TChunk> observable

The observable chunk collection

| Edit this page View Source

TryAddToExistingChunk(IObservableChunk<T, TChunk>, T, int)

Tries to add the item to an existing chunk

Declaration
protected virtual bool TryAddToExistingChunk(IObservableChunk<T, TChunk> observable, T item, int sourceStartIndex)
Parameters
Type Name Description
IObservableChunk<T, TChunk> observable

The observable chunk collection

T item

The item that shall be added

int sourceStartIndex

The index of the item in the source collection

Returns
Type Description
bool

True, if the item could be added to a chunk, otherwise False

Implements

IChunkBalancingStrategyProvider<T, TChunk>

Extension Methods

ExpressionExtensions.AsOne<T>(T)
  • Edit this page
  • View Source
In this article
Back to top Generated by DocFX