/** * move out of a leaf node that is currently out of (its own) bounds * @return null if we're now out-of-bounds of the whole tree */ private <K> NodeCursor<K> moveOutOfLeaf(boolean forwards, NodeCursor<K> cur, NodeCursor<K> ifFail) { while (true) { cur = cur.parent; if (cur == null) { root().inChild = false; return ifFail; } if (cur.advanceIntoBranchFromChild(forwards)) break; } cur.inChild = false; return cur; }
/** * move out of a leaf node that is currently out of (its own) bounds * @return null if we're now out-of-bounds of the whole tree */ private <K> NodeCursor<K> moveOutOfLeaf(boolean forwards, NodeCursor<K> cur, NodeCursor<K> ifFail) { while (true) { cur = cur.parent; if (cur == null) { root().inChild = false; return ifFail; } if (cur.advanceIntoBranchFromChild(forwards)) break; } cur.inChild = false; return cur; }
/** * move out of a leaf node that is currently out of (its own) bounds * @return null if we're now out-of-bounds of the whole tree */ private <K> NodeCursor<K> moveOutOfLeaf(boolean forwards, NodeCursor<K> cur, NodeCursor<K> ifFail) { while (true) { cur = cur.parent; if (cur == null) { root().inChild = false; return ifFail; } if (cur.advanceIntoBranchFromChild(forwards)) break; } cur.inChild = false; return cur; }
/** * move out of a leaf node that is currently out of (its own) bounds * @return null if we're now out-of-bounds of the whole tree */ private <K> NodeCursor<K> moveOutOfLeaf(boolean forwards, NodeCursor<K> cur, NodeCursor<K> ifFail) { while (true) { cur = cur.parent; if (cur == null) { root().inChild = false; return ifFail; } if (cur.advanceIntoBranchFromChild(forwards)) break; } cur.inChild = false; return cur; }