|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectneustore.base.DBPage
neustore.heapfile.HeapFilePage
public class HeapFilePage
A memory-version page of a heap file.
HeapFile
Field Summary | |
---|---|
protected int |
availableBytes
available space in the page |
protected int |
next
the next page in the linked list. |
protected int |
prev
the previous page in the linked list. |
protected java.util.Vector<neustore.heapfile.HeapFilePage.HeapFileRecord> |
records
the list of records |
protected int |
RESERVED
size for the reserved space. |
Fields inherited from class neustore.base.DBPage |
---|
nodeType, pageSize |
Constructor Summary | |
---|---|
HeapFilePage(int _pageSize,
Key _sampleKey,
Data _sampleData)
Constructor fo HeapFilePage. |
Method Summary | |
---|---|
boolean |
delete(Key key)
Deletes a record from the page. |
void |
insert(Key key,
Data data)
Inserts a new record into this page. |
boolean |
isFull()
Whether the page is full. |
int |
numRecs()
Returns the number of records in the page. |
protected void |
read(byte[] page)
Reads the object from a byte array. |
Data |
search(Key key)
Searches for a record in the page. |
protected void |
write(byte[] page)
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 |
Field Detail |
---|
protected final int RESERVED
protected java.util.Vector<neustore.heapfile.HeapFilePage.HeapFileRecord> records
protected int next
protected int prev
protected int availableBytes
Constructor Detail |
---|
public HeapFilePage(int _pageSize, Key _sampleKey, Data _sampleData)
HeapFile
,
here a sample key and a sample data are taken to enable the generic feature
of the index.
_pageSize
- page size_sampleKey
- a sample key_sampleData
- a sample dataMethod Detail |
---|
public int numRecs()
public boolean isFull()
public void insert(Key key, Data data)
key
- the key part of the new recorddata
- the data part of the new recordpublic Data search(Key key)
key
- the key to search for
public boolean delete(Key key)
key
- the key to delete
protected void read(byte[] page) throws java.io.IOException
DBPage
read
in class DBPage
java.io.IOException
protected void write(byte[] page) throws java.io.IOException
DBPage
write
in class DBPage
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |