Skip to content

Commit 1890ef6

Browse files
committed
enhance readability
1 parent 5b6b54b commit 1890ef6

File tree

1 file changed

+44
-10
lines changed

1 file changed

+44
-10
lines changed
Lines changed: 44 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,59 @@
11
using MiniSQL.Library.Models;
22
using MiniSQL.IndexManager.Models;
33
using System.Collections.Generic;
4-
using System;
54

65
namespace MiniSQL.IndexManager.Interfaces
76
{
87
public interface IIndexManager
98
{
10-
// when create table
9+
/// <summary>
10+
/// use when creating table
11+
/// </summary>
12+
/// <returns>The root node of the new B+ tree</returns>
1113
BTreeNode OccupyNewTableNode();
12-
// when drop table
14+
/// <summary>
15+
/// use when dropping table
16+
/// </summary>
17+
/// <param name="root">root node of the B+ Tree</param>
1318
void RemoveTree(BTreeNode root);
14-
// insert cell
15-
BTreeNode InsertCell(BTreeNode Root, DBRecord key, DBRecord dBRecord);
16-
// delete cell(s) that satisfy `condition`
17-
// `keyName` := primary key in table tree; indexed value in index tree
19+
/// <summary>
20+
/// insert a row/record/cell
21+
/// </summary>
22+
/// <param name="root">the root of the B+ tree</param>
23+
/// <param name="key">primary key in table tree and indexed column in index tree</param>
24+
/// <param name="dBRecord">new row of values to insert</param>
25+
/// <returns>new root node of the B+ tree</returns>
26+
BTreeNode InsertCell(BTreeNode root, DBRecord key, DBRecord dBRecord);
27+
/// <summary>
28+
/// delete cell(s) that satisfy `condition`
29+
/// </summary>
30+
/// <param name="root">the root of the B+ tree</param>
31+
/// <param name="condition">condition to satisfy</param>
32+
/// <param name="keyName">primary key in table tree; indexed value in index tree</param>
33+
/// <param name="attributeDeclarations">the names of the columns</param>
34+
/// <returns>new root node of the B+ tree</returns>
1835
BTreeNode DeleteCells(BTreeNode root, Expression condition, string keyName, List<AttributeDeclaration> attributeDeclarations);
19-
// return matches that satisfy `condition`
20-
// `keyName` := primary key in table tree; indexed value in index tree
36+
/// <summary>
37+
/// return matches that satisfy `condition`
38+
/// </summary>
39+
/// <param name="root">the root of the B+ tree</param>
40+
/// <param name="condition">condition to satisfy</param>
41+
/// <param name="keyName">primary key in table tree; indexed value in index tree</param>
42+
/// <param name="attributeDeclarations">the names of the columns</param>
43+
/// <returns>matches that satisfy `condition`</returns>
2144
List<BTreeCell> FindCells(BTreeNode root, Expression condition, string keyName, List<AttributeDeclaration> attributeDeclarations);
45+
/// <summary>
46+
/// find a row/record/cell by the key value
47+
/// </summary>
48+
/// <param name="key">primary key in table tree; indexed value in index tree</param>
49+
/// <param name="root">the root of the B+ tree</param>
50+
/// <returns>the matched cell</returns>
2251
BTreeCell FindCell(DBRecord key, BTreeNode root);
23-
System.Collections.Generic.IEnumerable<BTreeCell> LinearSearch(BTreeNode root);
52+
/// <summary>
53+
/// enumerate all leaf nodes of the B+ tree
54+
/// </summary>
55+
/// <param name="root">the root of the B+ tree</param>
56+
/// <returns>each leaf node</returns>
57+
IEnumerable<BTreeCell> LinearSearch(BTreeNode root);
2458
}
2559
}

0 commit comments

Comments
 (0)