Interface IObservableChunk<T, TChunk>
Denotes an abstract observable chunk collection
Namespace: NMF.Expressions.Linq
Assembly: NMF.Expressions.Chunk.dll
Syntax
public interface IObservableChunk<T, TChunk>
Type Parameters
Name | Description |
---|---|
T | The type of items |
TChunk | The type of chunks |
Properties
| Edit this page View SourceChunkCount
Gets the amount of chunks
Declaration
int ChunkCount { get; }
Property Value
Type | Description |
---|---|
int |
ChunkSize
Gets the size of the chunks
Declaration
int ChunkSize { get; }
Property Value
Type | Description |
---|---|
int |
Chunks
Gets the collection of chunks
Declaration
IReadOnlyList<TChunk> Chunks { get; }
Property Value
Type | Description |
---|---|
IReadOnlyList<TChunk> |
ElementCount
The the total number of elements
Declaration
int ElementCount { get; }
Property Value
Type | Description |
---|---|
int |
Methods
| Edit this page View SourceAddToChunk(int, T)
Adds the given element to the chunk with the provided index
Declaration
void AddToChunk(int chunkIndex, T item)
Parameters
Type | Name | Description |
---|---|---|
int | chunkIndex | The index of the chunk |
T | item | The item that should be added |
CreateChunkForItem(T)
Creates a chunk for the given item
Declaration
TChunk CreateChunkForItem(T item)
Parameters
Type | Name | Description |
---|---|---|
T | item | The item that should start a new chunk |
Returns
Type | Description |
---|---|
TChunk | The created chunk |
GetAccumulatedElementCount(int)
Gets the cumulative number of elements up the given chunk index
Declaration
int GetAccumulatedElementCount(int chunkIndex)
Parameters
Type | Name | Description |
---|---|---|
int | chunkIndex | The index of the chunk |
Returns
Type | Description |
---|---|
int | The number of all elements up to and including the provided chunk |
GetChunkItemAt(int, int)
Gets the item at the provided position
Declaration
T GetChunkItemAt(int chunkIndex, int chunkPosition)
Parameters
Type | Name | Description |
---|---|---|
int | chunkIndex | The index of the chunk |
int | chunkPosition | The position within the chunk |
Returns
Type | Description |
---|---|
T | The item |
GetChunkSize(int)
Gets the current size of the chunk with the given index
Declaration
int GetChunkSize(int chunkIndex)
Parameters
Type | Name | Description |
---|---|---|
int | chunkIndex | The index of the chunk |
Returns
Type | Description |
---|---|
int | The number of elements in the chunk |
RemoveChunk(int, ref List<TChunk>)
Removes the provided chunk completely
Declaration
void RemoveChunk(int chunkIndex, ref List<TChunk> removeList)
Parameters
Type | Name | Description |
---|---|---|
int | chunkIndex | The index of the chunk |
List<TChunk> | removeList | A reference to a list used for notifications |
RemoveFromChunk(int, int)
Removes the element with the given position from the chunk
Declaration
void RemoveFromChunk(int chunkIndex, int chunkPosition)
Parameters
Type | Name | Description |
---|---|---|
int | chunkIndex | The index of the chunk |
int | chunkPosition | The index within the chunk |