Top Description Fields Constructors Methods
org.h2.mvstore

public final Class CursorPos<K, V>

extends Object
Class Inheritance

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

Modifier and TypeField and Description
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.

public Page<K, V>
page

The page at the current level.

public CursorPos<K, V>
parent

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

Constructor Summary

AccessConstructor and Description
public
CursorPos(Page<K, V> page, int index, CursorPos<K, V> parent)

Method Summary

Modifier and TypeMethod and Description
pack-priv int

Returns:

the amount of memory
processRemovalInfo
(long
the version
version
)

Calculate the memory used by changes that are not yet stored.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

pack-priv static <
key type
K
,
value type
V
>
CursorPos<K, V>

Returns:

head of the CursorPos chain (insertion point)
traverseDown
(Page<K, V>
root of the tree
page
,
K
the key to search for
key
)

Searches for a given key and creates a breadcrumb trail through a B-tree rooted at a given Page.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

indexback to summary
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.

pageback to summary
public Page<K, V> page

The page at the current level.

parentback to summary
public CursorPos<K, V> parent

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

Constructor Detail

CursorPosback to summary
public CursorPos(Page<K, V> page, int index, CursorPos<K, V> parent)

Method Detail

processRemovalInfoback to summary
pack-priv int processRemovalInfo(long version)

Calculate the memory used by changes that are not yet stored.

Parameters
version:long

the version

Returns:int

the amount of memory

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override
traverseDownback to summary
pack-priv static <K, V> CursorPos<K, V> traverseDown(Page<K, V> page, K 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
<K>
key type
<V>
value type
page:Page<K, V>

root of the tree

key:K

the key to search for

Returns:CursorPos<K, V>

head of the CursorPos chain (insertion point)