P
- Page typepublic class MemoryPageFile<P extends Page> extends AbstractStoringPageFile<P>
Modifier and Type | Field and Description |
---|---|
private Map<Integer,P> |
file
Holds the pages.
|
emptyPages, nextPageID, pageSize
readAccess, writeAccess
Constructor and Description |
---|
MemoryPageFile(int pageSize)
Creates a new MemoryPageFile that is supported by a cache with the
specified parameters.
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clears this PageFile.
|
void |
deletePage(int pageID)
Deletes the node with the specified id from this file.
|
P |
readPage(int pageID)
Reads the page with the given id from this file.
|
protected void |
writePage(Integer pageID,
P page)
Perform the actual page write operation.
|
getInnerStatistics, getNextPageID, getPageSize, initialize, setNextPageID, setPageID
close, getReadOperations, getWriteOperations, resetPageAccess, writePage
public MemoryPageFile(int pageSize)
pageSize
- the size of a page in Bytespublic P readPage(int pageID)
PageFile
pageID
- the id of the page to be returnedprotected void writePage(Integer pageID, P page)
AbstractPageFile
writePage
in class AbstractPageFile<P extends Page>
pageID
- Page idpage
- Page to writepublic void deletePage(int pageID)
AbstractStoringPageFile
deletePage
in interface PageFile<P extends Page>
deletePage
in class AbstractStoringPageFile<P extends Page>
pageID
- the id of the node to be deletedpublic void clear()
PageFile