test.naiveheapfile
Class NaiveHeapFilePage

java.lang.Object
  extended by neustore.base.DBPage
      extended by test.naiveheapfile.NaiveHeapFilePage

public class NaiveHeapFilePage
extends DBPage

A DBPage as a component of a naive version of the heap file. This naive heap file is not meant to be used. Rather, it only shows an example of using the NEU Storage Package.

Author:
Donghui Zhang <donghui@ccs.neu.edu>
See Also:
NaiveHeapFile

Field Summary
 
Fields inherited from class neustore.base.DBPage
nodeType, pageSize
 
Constructor Summary
NaiveHeapFilePage(int _pageSize)
           
 
Method Summary
 void insert(int key)
          Inserts a new integer into this page.
 int numRecs()
          Returns the number of records in this page.
protected  void read(byte[] b)
          Reads the object from a byte array.
 boolean search(int key)
          Searches for an integer in this page.
protected  void write(byte[] b)
          Writes the object to a byte array.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NaiveHeapFilePage

public NaiveHeapFilePage(int _pageSize)
Method Detail

numRecs

public int numRecs()
Returns the number of records in this page.

Returns:
the number of records

insert

public void insert(int key)
Inserts a new integer into this page.

Parameters:
key - the new integer

search

public boolean search(int key)
Searches for an integer in this page.

Parameters:
key - the integer to search for
Returns:
whether found in this page

read

protected void read(byte[] b)
             throws java.io.IOException
Description copied from class: DBPage
Reads the object from a byte array.

Specified by:
read in class DBPage
Throws:
java.io.IOException

write

protected void write(byte[] b)
              throws java.io.IOException
Description copied from class: DBPage
Writes the object to a byte array.

Specified by:
write in class DBPage
Throws:
java.io.IOException