public abstract class BPlusNode extends Object
Modifier and Type | Field and Description |
---|---|
protected int |
numEntries |
Constructor and Description |
---|
BPlusNode(BPlusTree tree,
boolean isLeaf)
Abstract constructor for BPlusNode for new nodes.
|
BPlusNode(BPlusTree tree,
int pageNum,
boolean isLeaf)
Abstract constructor for BPlusNode for existing nodes.
|
Modifier and Type | Method and Description |
---|---|
protected List<BEntry> |
getAllValidEntries()
Return a list of valid, existing entries of this node.
|
static BPlusNode |
getBPlusNode(BPlusTree tree,
int pageNum)
Return an existing Node from a BPlusTree and pageNum.
|
Page |
getPage()
Fetch Page this BPlusNode exists on.
|
int |
getPageNum() |
BPlusTree |
getTree()
Retrieve the BPlusTree that this BPlusNode belongs to.
|
boolean |
hasSpace() |
InnerEntry |
insertBEntry(LeafEntry ent)
Insert an entry into this node.
|
boolean |
isLeaf() |
LeafNode |
locateLeaf(DataBox key,
boolean findFirst)
Recursively locate the child that leads to the leaf node.
|
protected void |
overwriteBNodeEntries(List<BEntry> entries)
Clear all the entries of this node, and write all the given entries into
the node, starting from the first entry number.
|
InnerEntry |
splitNode(BEntry newEntry)
Split BPlusNode driven by new entries.
|
public BPlusNode(BPlusTree tree, int pageNum, boolean isLeaf)
tree
- the BPlusTree this Node belongs topageNum
- the pageNum where to open this node onisLeaf
- is this node a leafpublic BPlusNode(BPlusTree tree, boolean isLeaf)
tree
- the BPlusTree this Node belongs toisLeaf
- is this node a leafpublic static BPlusNode getBPlusNode(BPlusTree tree, int pageNum)
tree
- the BPlusTree this Node belongs topageNum
- the page number on where this node exists onpublic Page getPage()
public int getPageNum()
public boolean hasSpace()
public BPlusTree getTree()
public InnerEntry splitNode(BEntry newEntry)
public boolean isLeaf()
protected List<BEntry> getAllValidEntries()
protected void overwriteBNodeEntries(List<BEntry> entries)
entries
- the list of entries to writepublic InnerEntry insertBEntry(LeafEntry ent)
ent
- the entry to insertpublic LeafNode locateLeaf(DataBox key, boolean findFirst)
key
- the key to search forfindFirst
- if true, returns the first leaf with the keyCopyright © 2017. All rights reserved.