APIdia Launch Partner
Top Description Fields Constructors Methods
io.github.spannm.jackcess.impl

public final Class TempPageHolder

extends Object
Class Inheritance
Imports
java.io.IOException, java.nio.ByteBuffer

Manages a reference to a page buffer.

Field Summary

Modifier and TypeField and Description
private final TempBufferHolder
private int
bufferModCount

the last "modification" count of the buffer that this holder observed.

private int

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public void
clear()

Forces any current page data to be disregarded (any getPage/setPage call must reload page data) and releases any referenced memory.

public ByteBuffer

Returns:

the page for the current page number, reading as necessary, position and limit are unchanged
getPage
(PageChannel pageChannel)

Returns the page for the current page number, reading as necessary, position and limit are unchanged.

public int

Returns:

the currently set page number
getPageNumber
()

Returns the currently set page number.

public void
invalidate()

Forces any current page data to be disregarded (any getPage/setPage call must reload page data).

public static TempPageHolder
newHolder(TempBufferHolder.Type
the type of reference desired for any create page buffers
type
)

Creates a new TempPageHolder.

public void
possiblyInvalidate(int modifiedPageNumber, ByteBuffer modifiedBuffer)

Forces any current page data to be disregarded if it matches the given page number (any getPage/setPage call must reload page data) and is not the given buffer.

public ByteBuffer
withNewPage(PageChannel pageChannel)

Allocates a new buffer in the database (with undefined data) and returns a new empty buffer.

public ByteBuffer

Returns:

the page for the new page number, reading as necessary, resets position
withPage
(PageChannel pageChannel, int newPageNumber)

Sets the current page number and returns that page

private ByteBuffer
withPage(PageChannel pageChannel, int newPageNumber, boolean rewind)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

bufferback to summary
private final TempBufferHolder buffer
bufferModCountback to summary
private int bufferModCount

the last "modification" count of the buffer that this holder observed. this is tracked so that the page data can be re-read if the underlying buffer has been discarded since the last page read

pageNumberback to summary
private int pageNumber

Constructor Detail

TempPageHolderback to summary
private TempPageHolder(TempBufferHolder.Type type)

Method Detail

clearback to summary
public void clear()

Forces any current page data to be disregarded (any getPage/setPage call must reload page data) and releases any referenced memory.

getPageback to summary
public ByteBuffer getPage(PageChannel pageChannel) throws IOException

Returns the page for the current page number, reading as necessary, position and limit are unchanged.

Returns:ByteBuffer

the page for the current page number, reading as necessary, position and limit are unchanged

getPageNumberback to summary
public int getPageNumber()

Returns the currently set page number.

Returns:int

the currently set page number

invalidateback to summary
public void invalidate()

Forces any current page data to be disregarded (any getPage/setPage call must reload page data). Does not necessarily release any memory.

newHolderback to summary
public static TempPageHolder newHolder(TempBufferHolder.Type type)

Creates a new TempPageHolder.

Parameters
type:TempBufferHolder.Type

the type of reference desired for any create page buffers

possiblyInvalidateback to summary
public void possiblyInvalidate(int modifiedPageNumber, ByteBuffer modifiedBuffer)

Forces any current page data to be disregarded if it matches the given page number (any getPage/setPage call must reload page data) and is not the given buffer. Does not necessarily release any memory.

withNewPageback to summary
public ByteBuffer withNewPage(PageChannel pageChannel) throws IOException

Allocates a new buffer in the database (with undefined data) and returns a new empty buffer.

withPageback to summary
public ByteBuffer withPage(PageChannel pageChannel, int newPageNumber) throws IOException

Sets the current page number and returns that page

Returns:ByteBuffer

the page for the new page number, reading as necessary, resets position

withPageback to summary
private ByteBuffer withPage(PageChannel pageChannel, int newPageNumber, boolean rewind) throws IOException