| com.quadcap.sql.file.Page
All known Subclasses: com.quadcap.sql.file.Block, com.quadcap.sql.file.SubPage,
Page | public interface Page (Code) | | This interface models a page of data in a block file, either a main page
(aka a Block) or a sub-page.
author: Stan Bailes |
Method Summary | |
public void | clear() | public void | decrRefCount() An artifact of the Cacheable interface implemented by the Block
class, we need to keep track of which objects are actually being
used so unused objects can be flushed from the cache to make room
for new objects. | public long | getPageNum() | public int | read(int pos, byte[] pbuf, int offset, int len) Read a range of bytes from the page. | public int | readInt(int pos) Read an integer (4-byte) value from the page. | public long | readLong(int pos) Read an long (8-byte) value from the page. | public void | takeData(Page p) Move the contents of the other page to this page, and zero out
the other page. | public int | write(int pos, byte[] pbuf, int offset, int len) Write a range of bytes to the page. | public void | writeInt(int pos, int val) Write an integer (4-byte) value to the page. | public void | writeLong(int pos, long val) Write an long (8-byte) value to the page. |
clear | public void clear()(Code) | | Zero this page
|
decrRefCount | public void decrRefCount()(Code) | | An artifact of the Cacheable interface implemented by the Block
class, we need to keep track of which objects are actually being
used so unused objects can be flushed from the cache to make room
for new objects. At some point, we can get rid of this in favor
of weak references.
|
getPageNum | public long getPageNum()(Code) | | Return this page's block number
|
read | public int read(int pos, byte[] pbuf, int offset, int len)(Code) | | Read a range of bytes from the page.
Parameters: pos - the offset in the page of the first byte to read Parameters: pbuf - the buffer into which the bytes are placed. Parameters: offset - the offset in pbuf where the first byteis placed. Parameters: len - the number of bytes to read |
readInt | public int readInt(int pos)(Code) | | Read an integer (4-byte) value from the page.
Parameters: pos - the offset in the page of the integer. |
readLong | public long readLong(int pos)(Code) | | Read an long (8-byte) value from the page.
Parameters: pos - the offset in the page of the long. |
takeData | public void takeData(Page p)(Code) | | Move the contents of the other page to this page, and zero out
the other page.
|
write | public int write(int pos, byte[] pbuf, int offset, int len)(Code) | | Write a range of bytes to the page.
Parameters: pos - the offset in the page of the first byte to write Parameters: pbuf - the buffer from which the bytes are obtained Parameters: offset - the offset in pbuf of the first byteto write Parameters: len - the number of bytes to write |
writeInt | public void writeInt(int pos, int val)(Code) | | Write an integer (4-byte) value to the page.
Parameters: pos - the offset in the page of the integer. Parameters: val - the integer value to write. |
writeLong | public void writeLong(int pos, long val)(Code) | | Write an long (8-byte) value to the page.
Parameters: pos - the offset in the page of the long. Parameters: val - the long value to write. |
|
|