Elexis API documentation
Version 2.1.6 as of December 11 2011

com.healthmarketscience.jackcess
Class TempPageHolder

java.lang.Object
  extended by com.healthmarketscience.jackcess.TempPageHolder

public final class TempPageHolder
extends java.lang.Object

Manages a reference to a page buffer.

Author:
James Ahlborn

Method Summary
 void clear()
          Forces any current page data to be disregarded (any getPage/setPage call must reload page data) and releases any referenced memory.
 java.nio.ByteBuffer getPage(PageChannel pageChannel)
           
 int getPageNumber()
           
 void invalidate()
          Forces any current page data to be disregarded (any getPage/setPage call must reload page data).
static TempPageHolder newHolder(TempBufferHolder.Type type)
          Creates a new TempPageHolder.
 void possiblyInvalidate(int modifiedPageNumber, java.nio.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.
 java.nio.ByteBuffer setNewPage(PageChannel pageChannel)
          Allocates a new buffer in the database (with undefined data) and returns a new empty buffer.
 java.nio.ByteBuffer setPage(PageChannel pageChannel, int pageNumber)
          Sets the current page number and returns that page
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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 java.nio.ByteBuffer getPage(PageChannel pageChannel)
                            throws java.io.IOException
Returns:
the page for the current page number, reading as necessary, position and limit are unchanged
Throws:
java.io.IOException

setPage

public java.nio.ByteBuffer setPage(PageChannel pageChannel,
                                   int pageNumber)
                            throws java.io.IOException
Sets the current page number and returns that page

Returns:
the page for the new page number, reading as necessary, resets position
Throws:
java.io.IOException

setNewPage

public java.nio.ByteBuffer setNewPage(PageChannel pageChannel)
                               throws java.io.IOException
Allocates a new buffer in the database (with undefined data) and returns a new empty buffer.

Throws:
java.io.IOException

invalidate

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.


possiblyInvalidate

public void possiblyInvalidate(int modifiedPageNumber,
                               java.nio.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.


clear

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


Elexis API documentation
Version 2.1.6 as of December 11 2011

Copyright 2005-2011 by Gerry Weirich, Elexis