mirror of
https://github.com/tu-darmstadt-informatik/AuD18.git
synced 2025-12-13 01:45:49 +00:00
Add comments
This commit is contained in:
parent
e98234331b
commit
2c8a08074e
@ -328,6 +328,11 @@ public class B_TreeNode {
|
||||
|
||||
// These getter / setter methods try to enforce reasonable constraints to make debugging easier
|
||||
|
||||
/**
|
||||
* Returns the entry at position i of the node
|
||||
* @param i Index of the entry to get
|
||||
* @return Entry at position i
|
||||
*/
|
||||
public Entry getEntry(int i) {
|
||||
if(i > this.currentLoad - 1)
|
||||
throw new RuntimeException("Trying to get non-existent entry");
|
||||
@ -337,9 +342,15 @@ public class B_TreeNode {
|
||||
return res;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the i-th entry of the node
|
||||
* @param i Index of the entry to set
|
||||
* @param value Entry to set
|
||||
*/
|
||||
public void setEntry(int i, Entry value) {
|
||||
if(i > this.currentLoad- 1)
|
||||
throw new RuntimeException("Trying to set non-existent entry");
|
||||
// keys.set might fail if the node capacity has been expanded, use add in that case
|
||||
if(this.keys.size() <= i)
|
||||
keys.add(value);
|
||||
else
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user