public InPageNode(bool isleaf, bool tuple, InPageNode par, InPageNode nextleaf, Node cell, int leafMaxSize, int nonLeafMaxSize) { this.IsLeaf = isleaf; this.Cell = cell; this.LeafMaxSize = leafMaxSize; this.NonLeafMaxSize = nonLeafMaxSize; if (this.IsLeaf) { this.Tuple = tuple; this.NextLeaf = nextleaf; this.Parent = par; this.TupleID = new Node[this.LeafMaxSize]; this.LeafKeys = new int?[this.LeafMaxSize]; } else { this.Parent = par; this.NonLeafKeys = new int?[this.NonLeafMaxSize - 1]; this.ChildrenPointers = new InPageNode[this.NonLeafMaxSize]; } }
public Node(bool leaf, bool tuple, int nonLeafNodeMaxCount, int leafNodeMaxCount, int inPageLeafMaxSize, int inPageNonLeafMaxSize) { Root = new InPageNode(leaf, tuple, null, null, this, inPageLeafMaxSize, inPageNonLeafMaxSize); this.LeafNodeMaxCount = leafNodeMaxCount; this.NonLeafNodeMaxCount = nonLeafNodeMaxCount; ++this.CurrentLeafNodeCount; this.CurrentNumberOfLevels = 1; this.CurrentFreeLeaf = this.LeafNodeMaxCount * (Root.LeafMaxSize - 1); this.Childrens = new Node[this.LeafNodeMaxCount * Root.LeafMaxSize]; }