org.h2.index

## Class PageBtree

- java.lang.Object
- - org.h2.util.CacheObject
  - - org.h2.store.Page
    - - org.h2.index.PageBtree

All Implemented Interfaces:
  java.lang.Comparable<CacheObject>

Direct Known Subclasses:
  PageBtreeLeaf, PageBtreeNode

    public abstract class PageBtree
    extends Page

A page that contains index data.

### Field Summary

Fields
`protected Data` `data` The data page.
`protected int` `entryCount` The number of entries.
`protected PageBtreeIndex` `index` The index.
`protected int[]` `offsets` The row offsets.
`protected boolean` `onlyPosition` If only the position of the row is stored in the page
`protected int` `parentPageId` The page number of the parent.
`protected SearchRow[]` `rows` The index data
`protected int` `start` The start of the data area.
`protected boolean` `written` Whether the data page is up-to-date.

### Fields inherited from class org.h2.store.Page

`changeCount, FLAG_LAST, TYPE_BTREE_LEAF, TYPE_BTREE_NODE, TYPE_DATA_LEAF, TYPE_DATA_NODE, TYPE_DATA_OVERFLOW, TYPE_EMPTY, TYPE_FREE_LIST, TYPE_STREAM_DATA, TYPE_STREAM_TRUNK`

### Fields inherited from class org.h2.util.CacheObject

`cacheChained, cacheNext, cachePrevious`

### Method Summary

Methods
`boolean` `canRemove()` Check if the object can be removed from the cache.
`int` `getMemory()` Get the estimated memory size.
`protected void` `memoryChange()` The memory usage of this page was changed.
`protected void` `readAllRows()` Ensure all rows are read in memory.

### Methods inherited from class org.h2.store.Page

`add, canMove, insert, insert, insert, moveTo, remove, remove, remove, write`

### Methods inherited from class org.h2.util.CacheObject

`compareTo, getPos, isChanged, isStream, setChanged, setPos`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### index

    protected final PageBtreeIndex index

The index.

#### parentPageId

    protected int parentPageId

The page number of the parent.

#### data

    protected final Data data

The data page.

#### offsets

    protected int[] offsets

The row offsets.

#### entryCount

    protected int entryCount

The number of entries.

#### rows

    protected SearchRow[] rows

The index data

#### start

    protected int start

The start of the data area.

#### onlyPosition

    protected boolean onlyPosition

If only the position of the row is stored in the page

#### written

    protected boolean written

Whether the data page is up-to-date.

### Method Detail

#### memoryChange

    protected void memoryChange()

The memory usage of this page was changed. Propagate the change if needed.

#### readAllRows

    protected void readAllRows()

Ensure all rows are read in memory.

#### getMemory

    public int getMemory()

Get the estimated memory size.

Specified by:
  `getMemory` in class `CacheObject`
Returns:
  number of double words (4 bytes)

#### canRemove

    public boolean canRemove()

Description copied from class: `CacheObject`
Check if the object can be removed from the cache. For example pinned objects can not be removed.

Specified by:
  `canRemove` in class `CacheObject`
Returns:
  true if it can be removed