@Override PageBtreeLeaf getLastLeaf() { int child = childPageIds[entryCount]; return index.getPage(child).getLastLeaf(); }
/** * Set the cursor to the last row of the previous page. * * @param cursor the cursor * @param pageId id of the previous page */ void previousPage(PageBtreeCursor cursor, int pageId) { int i; // TODO maybe keep the index in the child page (transiently) for (i = entryCount; i >= 0; i--) { if (childPageIds[i] == pageId) { i--; break; } } if (i < 0) { if (parentPageId == PageBtree.ROOT) { cursor.setCurrent(null, 0); return; } PageBtreeNode previous = (PageBtreeNode) index.getPage(parentPageId); previous.previousPage(cursor, getPos()); return; } PageBtree page = index.getPage(childPageIds[i]); PageBtreeLeaf leaf = page.getLastLeaf(); cursor.setCurrent(leaf, leaf.entryCount - 1); }
@Override PageBtreeLeaf getLastLeaf() { int child = childPageIds[entryCount]; return index.getPage(child).getLastLeaf(); }
@Override PageBtreeLeaf getLastLeaf() { int child = childPageIds[entryCount]; return index.getPage(child).getLastLeaf(); }
/** * Set the cursor to the last row of the previous page. * * @param cursor the cursor * @param pageId id of the previous page */ void previousPage(PageBtreeCursor cursor, int pageId) { int i; // TODO maybe keep the index in the child page (transiently) for (i = entryCount; i >= 0; i--) { if (childPageIds[i] == pageId) { i--; break; } } if (i < 0) { if (parentPageId == PageBtree.ROOT) { cursor.setCurrent(null, 0); return; } PageBtreeNode previous = (PageBtreeNode) index.getPage(parentPageId); previous.previousPage(cursor, getPos()); return; } PageBtree page = index.getPage(childPageIds[i]); PageBtreeLeaf leaf = page.getLastLeaf(); cursor.setCurrent(leaf, leaf.entryCount - 1); }
/** * Set the cursor to the last row of the previous page. * * @param cursor the cursor * @param pageId id of the previous page */ void previousPage(PageBtreeCursor cursor, int pageId) { int i; // TODO maybe keep the index in the child page (transiently) for (i = entryCount; i >= 0; i--) { if (childPageIds[i] == pageId) { i--; break; } } if (i < 0) { if (parentPageId == PageBtree.ROOT) { cursor.setCurrent(null, 0); return; } PageBtreeNode previous = (PageBtreeNode) index.getPage(parentPageId); previous.previousPage(cursor, getPos()); return; } PageBtree page = index.getPage(childPageIds[i]); PageBtreeLeaf leaf = page.getLastLeaf(); cursor.setCurrent(leaf, leaf.entryCount - 1); }