int getPagePosition ( AbstractIndexPage indexPage ) { //We know that the element exists, so we iterate to list.length instead of nEntires //(which is not available in this context at the moment. for ( int i = 0 ; i < subPages . length ; i ++ ) { if ( subPages [ i ] == indexPage ) { return i ; } } throw DBLogger . newFatalInternal ( "Leaf page not found in parent page: " + indexPage . pageId + " " + Arrays . toString ( subPageIds ) ) ; }
This method will fail if called on the first page in the tree . However this should not happen because when called we already have a reference to a previous page .