Class PagedBTree.PageContext<I extends io.github.jmcleodfoss.pst.BTree,​L extends BTreeLeaf>

java.lang.Object
io.github.jmcleodfoss.pst.PagedBTree.PageContext<I,​L>
Enclosing class:
PagedBTree

protected abstract static class PagedBTree.PageContext<I extends io.github.jmcleodfoss.pst.BTree,​L extends BTreeLeaf>
extends Object
The PageContext class contains information required to keep track of the current position in the B-tree during input.
  • Constructor Summary

    Constructors 
    Modifier Constructor Description
    protected PageContext​(io.github.jmcleodfoss.pst.BREF bref, PSTFile pstFile)
    Create a PageContext object form the given pstFile and bref.
  • Method Summary

    Modifier and Type Method Description
    protected ByteBuffer entryDataStream()
    Obtain a data stream from which the B-tree entries may be read.
    protected int getEntrySize()
    Retrieve the number of bytes including unread padding in an entry.
    protected int getNumEntries()
    Obtain the number of entries found in this page.
    protected boolean isLeafNode()
    Determine whether the current node is a leaf node or an intermediate node.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • PageContext

      protected PageContext​(io.github.jmcleodfoss.pst.BREF bref, PSTFile pstFile) throws IOException
      Create a PageContext object form the given pstFile and bref.
      Parameters:
      bref - The block reference for this page.
      pstFile - The PST file's data stream, header, etc.
      Throws:
      IOException - An I/O error was encountered while either seeking the page context's position in the file or while reading the page context data.
  • Method Details

    • entryDataStream

      protected ByteBuffer entryDataStream() throws IOException
      Obtain a data stream from which the B-tree entries may be read.
      Returns:
      A data entry stream from which the page may be read.
      Throws:
      IOException - There was a problem reading the PST file.
    • getEntrySize

      protected int getEntrySize()
      Retrieve the number of bytes including unread padding in an entry.
      Returns:
      The number of bytes between the start of each entry in the B-tree.
    • getNumEntries

      protected int getNumEntries()
      Obtain the number of entries found in this page.
      Returns:
      The number of B-Tree entries on this page.
    • isLeafNode

      protected boolean isLeafNode()
      Determine whether the current node is a leaf node or an intermediate node.
      Returns:
      true if the current node is a leaf node, false if it is an intermediate node.