All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class btree.BTLeafPage

java.lang.Object
   |
   +----diskmgr.Page
           |
           +----heap.HFPage
                   |
                   +----btree.BTSortedPage
                           |
                           +----btree.BTLeafPage

public class BTLeafPage
extends BTSortedPage
A BTLeafPage is a leaf page on a B+ tree. It holds abstract pairs; it doesn't know anything about the keys (their lengths or their types), instead relying on the abstract interface consisting of BT.java.


Constructor Index

 o BTLeafPage(int)
new a page, associate the BTLeafPage instance with the Page instance, also it sets the type to be NodeType.LEAF.
 o BTLeafPage(Page, int)
associate the BTLeafPage instance with the Page instance, also it sets the type to be NodeType.LEAF.
 o BTLeafPage(PageId, int)
pin the page with pageno, and get the corresponding BTLeafPage, also it sets the type to be NodeType.LEAF.

Method Index

 o delEntry(KeyDataEntry)
delete a data entry in the leaf page.
 o getCurrent(RID)
getCurrent returns the current record in the iteration; it is like getNext except it does not advance the iterator.
 o getFirst(RID)
Iterators.
 o getNext(RID)
Iterators.
 o insertRecord(KeyClass, RID)
insertRecord.

Constructors

 o BTLeafPage
 public BTLeafPage(PageId pageno,
                   int keyType)
pin the page with pageno, and get the corresponding BTLeafPage, also it sets the type to be NodeType.LEAF.

Parameters:
pageno - Input parameter. To specify which page number the BTLeafPage will correspond to.
keyType - either AttrType.attrInteger or AttrType.attrString. Input parameter.
 o BTLeafPage
 public BTLeafPage(Page page,
                   int keyType)
associate the BTLeafPage instance with the Page instance, also it sets the type to be NodeType.LEAF.

Parameters:
page - input parameter. To specify which page the BTLeafPage will correspond to.
keyType - either AttrType.attrInteger or AttrType.attrString. Input parameter.
 o BTLeafPage
 public BTLeafPage(int keyType)
new a page, associate the BTLeafPage instance with the Page instance, also it sets the type to be NodeType.LEAF.

Parameters:
keyType - either AttrType.attrInteger or AttrType.attrString. Input parameter.

Methods

 o insertRecord
 public RID insertRecord(KeyClass key,
                         RID dataRid)
insertRecord. READ THIS DESCRIPTION CAREFULLY. THERE ARE TWO RIDs WHICH MEAN TWO DIFFERENT THINGS. Inserts a key, rid value into the leaf node. This is accomplished by a call to SortedPage::insertRecord() Parameters:

Parameters:
key - - the key value of the data record. Input parameter.
dataRid - - the rid of the data record. This is stored on the leaf page along with the corresponding key value. Input parameter.
Returns:
- the rid of the inserted leaf record data entry, i.e., the pair.
 o getFirst
 public KeyDataEntry getFirst(RID rid)
Iterators. One of the two functions: getFirst and getNext which provide an iterator interface to the records on a BTLeafPage.

Parameters:
rid - It will be modified and the first rid in the leaf page will be passed out by itself. Input and Output parameter.
Returns:
return the first KeyDataEntry in the leaf page. null if no more record
 o getNext
 public KeyDataEntry getNext(RID rid)
Iterators. One of the two functions: getFirst and getNext which provide an iterator interface to the records on a BTLeafPage.

Parameters:
rid - It will be modified and the next rid will be passed out by itself. Input and Output parameter.
Returns:
return the next KeyDataEntry in the leaf page. null if no more record.
 o getCurrent
 public KeyDataEntry getCurrent(RID rid)
getCurrent returns the current record in the iteration; it is like getNext except it does not advance the iterator.

Parameters:
rid - the current rid. Input and Output parameter. But Output=Input.
Returns:
return the current KeyDataEntry
 o delEntry
 public boolean delEntry(KeyDataEntry dEntry)
delete a data entry in the leaf page.

Parameters:
dEntry - the entry will be deleted in the leaf page. Input parameter.
Returns:
true if deleted; false if no dEntry in the page

All Packages  Class Hierarchy  This Package  Previous  Next  Index