Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
ChunkNode.cs
1using System.Diagnostics;
2
4{
8 [DebuggerDisplay("Count = {Count}, Start = {Start}, Pos = {Pos}, Size = {Size}")]
9 [DebuggerTypeProxy(typeof(ChunkNodeDebugView<>))]
10 public class ChunkNode<T>
11 {
12 private readonly ChunkedList<T>.Chunk chunk;
13
18 internal ChunkNode(ChunkedList<T>.Chunk Chunk)
19 {
20 this.chunk = Chunk;
21 }
22
26 public ChunkNode<T> Next => this.chunk.Next?.Node;
27
31 public ChunkNode<T> Prev => this.chunk.Prev?.Node;
32
36 public T[] Elements => this.chunk.Elements;
37
41 public int Size => this.chunk.Size;
42
46 public int Start => this.chunk.Start;
47
51 public int Pos => this.chunk.Pos;
52
56 public int Count => this.chunk.Pos - this.chunk.Start;
57
62 public override string ToString()
63 {
64 return this.chunk.ToString();
65 }
66
73 public T this[int Index]
74 {
75 get => this.chunk[Index];
76 set => this.chunk[Index] = value;
77 }
78 }
79}
Node referencing a chunk in a ChunkedList<T>
Definition: ChunkNode.cs:11
override string ToString()
String representation of chunk.
Definition: ChunkNode.cs:62
ChunkNode< T > Next
Next chunk
Definition: ChunkNode.cs:26
int Pos
Index after the last element in chunk.
Definition: ChunkNode.cs:51
int Count
Number of elements in chunk.
Definition: ChunkNode.cs:56
T[] Elements
Array of elements in chunk.
Definition: ChunkNode.cs:36
ChunkNode< T > Prev
Previous chunk
Definition: ChunkNode.cs:31
int Start
Index of first element in chunk.
Definition: ChunkNode.cs:46
A chunked list is a linked list of chunks of objects of type T .
Definition: ChunkedList.cs:54