|
|
|||||||||||||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.lmu.ifi.dbs.elki.persistent.PageFile<P>
de.lmu.ifi.dbs.elki.persistent.MemoryPageFile<P>
P
- Page typepublic class MemoryPageFile<P extends Page<P>>
A memory based implementation of a PageFile that simulates I/O-access.
Implemented as a Map with keys representing the ids of the saved pages.
Field Summary | |
---|---|
private Map<Integer,P> |
file
Holds the pages. |
Fields inherited from class de.lmu.ifi.dbs.elki.persistent.PageFile |
---|
cache, emptyPages, nextPageID, pageSize, readAccess, writeAccess |
Constructor Summary | |
---|---|
MemoryPageFile(int pageSize,
int cacheSize,
Cache<P> cache)
Creates a new MemoryPageFile that is supported by a cache with the specified parameters. |
Method Summary | |
---|---|
void |
clear()
Clears this PageFile. |
void |
deletePage(int pageID)
Deletes the node with the specified id from this file. |
void |
objectRemoved(P page)
This method is called by the cache if the page is not longer
stored in the cache and has to be written to disk. |
P |
readPage(int pageID)
Reads the page with the given id from this file. |
Methods inherited from class de.lmu.ifi.dbs.elki.persistent.PageFile |
---|
close, getLogicalPageAccess, getNextPageID, getPhysicalReadAccess, getPhysicalWriteAccess, initCache, resetPageAccess, setCacheSize, setNextPageID, setPageID, writePage |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private final Map<Integer,P extends Page<P>> file
Constructor Detail |
---|
public MemoryPageFile(int pageSize, int cacheSize, Cache<P> cache)
pageSize
- the size of a page in BytescacheSize
- the size of the cache in Bytecache
- the class of the cache to be usedMethod Detail |
---|
public void objectRemoved(P page)
CachedFile
page
is not longer
stored in the cache and has to be written to disk.
page
- the page which has to be written to diskpublic P readPage(int pageID)
readPage
in class PageFile<P extends Page<P>>
pageID
- the id of the page to be returned
public void deletePage(int pageID)
deletePage
in class PageFile<P extends Page<P>>
pageID
- the id of the node to be deletedpublic void clear()
clear
in class PageFile<P extends Page<P>>
|
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |