simpledb.index.btree
Class BTPageFormatter
java.lang.Object
simpledb.index.btree.BTPageFormatter
- All Implemented Interfaces:
- PageFormatter
public class BTPageFormatter
- extends Object
- implements PageFormatter
An object that can format a page to look like an
empty B-tree block.
- Author:
- Edward Sciore
Constructor Summary |
BTPageFormatter(TableInfo ti,
int flag)
Creates a formatter for a new page of the
specified B-tree index. |
Method Summary |
void |
format(Page page)
Formats the page by initializing as many index-record slots
as possible to have default values. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BTPageFormatter
public BTPageFormatter(TableInfo ti,
int flag)
- Creates a formatter for a new page of the
specified B-tree index.
- Parameters:
ti
- the index's metadataflag
- the page's initial flag value
format
public void format(Page page)
- Formats the page by initializing as many index-record slots
as possible to have default values.
Each integer field is given a value of 0, and
each string field is given a value of "".
The location that indicates the number of records
in the page is also set to 0.
- Specified by:
format
in interface PageFormatter
- Parameters:
page
- a buffer page- See Also:
PageFormatter.format(simpledb.file.Page)
Copyright © 2011. All Rights Reserved.