simpledb.record
Class RecordFormatter

java.lang.Object
  extended by simpledb.record.RecordFormatter
All Implemented Interfaces:
PageFormatter

 class RecordFormatter
extends java.lang.Object
implements PageFormatter

An object that can format a page to look like a block of empty records.

Author:
Edward Sciore

Constructor Summary
RecordFormatter(TableInfo ti)
          Creates a formatter for a new page of a table.
 
Method Summary
 void format(Page page)
          Formats the page by allocating as many record slots as possible, given the record length.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RecordFormatter

public RecordFormatter(TableInfo ti)
Creates a formatter for a new page of a table.

Parameters:
ti - the table's metadata
Method Detail

format

public void format(Page page)
Formats the page by allocating as many record slots as possible, given the record length. Each record slot is assigned a flag of EMPTY. Each integer field is given a value of 0, and each string field is given a value of "".

Specified by:
format in interface PageFormatter
Parameters:
page - a buffer page
See Also:
PageFormatter.format(simpledb.file.Page)