java.lang.Object
org.dizitart.no2.mvstore.compat.v1.mvstore.CursorPos

public class CursorPos extends Object
A position in a cursor. Instance represents a node in the linked list, which traces path from a specific (target) key within a leaf node all the way up to te root (bottom up path).
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    int
    Index of the key (within page above) used to go down to a lower level in case of intermediate nodes, or index of the target key for leaf a node.
    The page at the current level.
    Next node in the linked list, representing the position within parent level, or null, if we are at the root level already.
  • Constructor Summary

    Constructors
    Constructor
    Description
    CursorPos(Page page, int index, CursorPos parent)
     
  • Method Summary

    Modifier and Type
    Method
    Description
     
    static CursorPos
    traverseDown(Page page, Object key)
    Searches for a given key and creates a breadcrumb trail through a B-tree rooted at a given Page.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • page

      public Page page
      The page at the current level.
    • index

      public int index
      Index of the key (within page above) used to go down to a lower level in case of intermediate nodes, or index of the target key for leaf a node. In a later case, it could be negative, if the key is not present.
    • parent

      public CursorPos parent
      Next node in the linked list, representing the position within parent level, or null, if we are at the root level already.
  • Constructor Details

    • CursorPos

      public CursorPos(Page page, int index, CursorPos parent)
  • Method Details

    • traverseDown

      public static CursorPos traverseDown(Page page, Object key)
      Searches for a given key and creates a breadcrumb trail through a B-tree rooted at a given Page. Resulting path starts at "insertion point" for a given key and goes back to the root.
      Parameters:
      page - root of the tree
      key - the key to search for
      Returns:
      head of the CursorPos chain (insertion point)
    • toString

      public String toString()
      Overrides:
      toString in class Object