Class TempPageHolder
- java.lang.Object
-
- com.healthmarketscience.jackcess.impl.TempPageHolder
-
public final class TempPageHolder extends Object
Manages a reference to a page buffer.- Author:
- James Ahlborn
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()Forces any current page data to be disregarded (anygetPage/setPagecall must reload page data) and releases any referenced memory.ByteBuffergetPage(PageChannel pageChannel)intgetPageNumber()voidinvalidate()Forces any current page data to be disregarded (anygetPage/setPagecall must reload page data).static TempPageHoldernewHolder(TempBufferHolder.Type type)Creates a new TempPageHolder.voidpossiblyInvalidate(int modifiedPageNumber, ByteBuffer modifiedBuffer)Forces any current page data to be disregarded if it matches the given page number (anygetPage/setPagecall must reload page data) and is not the given buffer.ByteBuffersetNewPage(PageChannel pageChannel)Allocates a new buffer in the database (with undefined data) and returns a new empty buffer.ByteBuffersetPage(PageChannel pageChannel, int pageNumber)Sets the current page number and returns that page
-
-
-
Method Detail
-
newHolder
public static TempPageHolder newHolder(TempBufferHolder.Type type)
Creates a new TempPageHolder.- Parameters:
type- the type of reference desired for any create page buffers
-
getPageNumber
public int getPageNumber()
- Returns:
- the currently set page number
-
getPage
public ByteBuffer getPage(PageChannel pageChannel) throws IOException
- Returns:
- the page for the current page number, reading as necessary, position and limit are unchanged
- Throws:
IOException
-
setPage
public ByteBuffer setPage(PageChannel pageChannel, int pageNumber) throws IOException
Sets the current page number and returns that page- Returns:
- the page for the new page number, reading as necessary, resets position
- Throws:
IOException
-
setNewPage
public ByteBuffer setNewPage(PageChannel pageChannel) throws IOException
Allocates a new buffer in the database (with undefined data) and returns a new empty buffer.- Throws:
IOException
-
invalidate
public void invalidate()
Forces any current page data to be disregarded (anygetPage/setPagecall must reload page data). Does not necessarily release any memory.
-
possiblyInvalidate
public void possiblyInvalidate(int modifiedPageNumber, ByteBuffer modifiedBuffer)Forces any current page data to be disregarded if it matches the given page number (anygetPage/setPagecall must reload page data) and is not the given buffer. Does not necessarily release any memory.
-
clear
public void clear()
Forces any current page data to be disregarded (anygetPage/setPagecall must reload page data) and releases any referenced memory.
-
-