de.lmu.ifi.dbs.elki.persistent
Interface PageFile<P extends Page>

Type Parameters:
P - Page file
All Superinterfaces:
PageFileStatistics
All Known Implementing Classes:
AbstractPageFile, AbstractStoringPageFile, LRUCache, MemoryPageFile, OnDiskArrayPageFile, PersistentPageFile

public interface PageFile<P extends Page>
extends PageFileStatistics

Page file interface.


Method Summary
 void clear()
          Clears this PageFile.
 void close()
          Closes this file.
 void deletePage(int pageID)
          Deletes the node with the specified id from this file.
 int getNextPageID()
          Returns the next page id.
 int getPageSize()
          Get the page size of this page file.
 boolean initialize(PageHeader header)
          Initialize the page file with the given header - return "true" if the file already existed.
 P readPage(int pageID)
          Reads the page with the given id from this file.
 void setNextPageID(int nextPageID)
          Sets the next page id.
 Integer setPageID(P page)
          Sets the id of the given page.
 int writePage(P page)
          Writes a page into this file.
 
Methods inherited from interface de.lmu.ifi.dbs.elki.persistent.PageFileStatistics
getInnerStatistics, getReadOperations, getWriteOperations, resetPageAccess
 

Method Detail

setPageID

Integer setPageID(P page)
Sets the id of the given page.

Parameters:
page - the page to set the id
Returns:
the page id

writePage

int writePage(P page)
Writes a page into this file. The method tests if the page has already an id, otherwise a new id is assigned and returned.

Parameters:
page - the page to be written
Returns:
the id of the page

readPage

P readPage(int pageID)
Reads the page with the given id from this file.

Parameters:
pageID - the id of the page to be returned
Returns:
the page with the given pageId

deletePage

void deletePage(int pageID)
Deletes the node with the specified id from this file.

Parameters:
pageID - the id of the node to be deleted

close

void close()
Closes this file.


clear

void clear()
Clears this PageFile.


getNextPageID

int getNextPageID()
Returns the next page id.

Returns:
the next page id

setNextPageID

void setNextPageID(int nextPageID)
Sets the next page id.

Parameters:
nextPageID - the next page id to be set

getPageSize

int getPageSize()
Get the page size of this page file.

Returns:
page size

initialize

boolean initialize(PageHeader header)
Initialize the page file with the given header - return "true" if the file already existed.

Parameters:
header - Header
Returns:
true when the file already existed.

Release 0.4.0 (2011-09-20_1324)